summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus
diff options
context:
space:
mode:
authorRené Schümann <white06tiger@gmail.com>2014-04-11 17:22:27 +0000
committerRené Schümann <white06tiger@gmail.com>2014-04-11 17:22:27 +0000
commit2e96c3880c010e34363be9300ebbc7935de4a67a (patch)
tree83b12021e0e020d52d30b51b0d300f4ba432745b /plugins/SendScreenshotPlus
parent99e1f60a6570c12fd02a9a2ebe8915680d2bfcec (diff)
SendSS:
+ CSend now handles image upload via HTTP, at least provides helper functions for POST requests (CSend) - CSendImageShack simplified and removed custom HTTP form stuff as it's now integrated and easier to use in CSend (CSendImageShack) * version bump and User-Agent fix (version.h) git-svn-id: http://svn.miranda-ng.org/main/trunk@8958 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SendScreenshotPlus')
-rw-r--r--plugins/SendScreenshotPlus/src/CSend.cpp162
-rw-r--r--plugins/SendScreenshotPlus/src/CSend.h15
-rw-r--r--plugins/SendScreenshotPlus/src/CSendImageShack.cpp244
-rw-r--r--plugins/SendScreenshotPlus/src/CSendImageShack.h13
-rw-r--r--plugins/SendScreenshotPlus/src/version.h6
5 files changed, 221 insertions, 219 deletions
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp
index b79fd340cd..a2b2e7e9b3 100644
--- a/plugins/SendScreenshotPlus/src/CSend.cpp
+++ b/plugins/SendScreenshotPlus/src/CSend.cpp
@@ -447,3 +447,165 @@ void CSend::Exit(unsigned int Result) {
if(m_bAsync)
delete this;/// deletes derived class since destructor is virtual (which also auto-calls base dtor)
}
+
+/// helper functions used for HTTP uploads
+//---------------------------------------------------------------------------
+const char* CSend::GetHTMLContent(char* str, const char* startTag, const char* endTag) {
+ char* begin=strstr(str,startTag);
+ if(!begin) return NULL;
+ begin+=strlen(startTag);
+ char* end=strstr(begin,endTag);
+ if(end) *end=0;
+ return begin;
+}
+
+static void HTTPFormAppendData(NETLIBHTTPREQUEST* nlhr, size_t* dataMax, char** dataPos, const char* data,size_t len){
+ nlhr->dataLength=(*dataPos-nlhr->pData);
+ if(nlhr->dataLength+len >= *dataMax){
+ *dataPos=nlhr->pData;
+ *dataMax+=0x1000+0x1000*(len>>12);
+ nlhr->pData=(char*)mir_realloc(nlhr->pData,*dataMax);
+ if(!nlhr->pData) mir_free(*dataPos);
+ *dataPos=nlhr->pData;
+ if(!*dataPos)
+ return;
+ *dataPos+=nlhr->dataLength;
+ }
+ if(data){
+ memcpy(*dataPos,data,sizeof(char)*len); *dataPos+=len;
+ nlhr->dataLength+=len; // not necessary
+ }
+}
+void CSend::HTTPFormDestroy(NETLIBHTTPREQUEST* nlhr)
+{
+ mir_free(nlhr->headers[0].szValue), nlhr->headers[0].szValue=NULL;
+ mir_free(nlhr->headers), nlhr->headers=NULL;
+ mir_free(nlhr->pData), nlhr->pData=NULL;
+}
+int CSend::HTTPFormCreate(NETLIBHTTPREQUEST* nlhr,int requestType,char* url,HTTPFormData* frm,size_t frmNum)
+{
+ char boundary[16];
+ memcpy(boundary,"--M461C/",8);
+ {
+ union{
+ DWORD num;
+ unsigned char cr[4];
+ };num=GetTickCount()^0x8000;
+ for(int i=0; i<4; ++i){
+ unsigned char chcode=cr[i]>>4;
+ boundary[8+i*2]=(chcode<0x0a ? '0' : 'a'-0x0a)+chcode;
+ chcode=cr[i]&0x0f;
+ boundary[9+i*2]=(chcode<0x0a ? '0' : 'a'-0x0a)+chcode;
+ }
+ }
+ nlhr->cbSize =sizeof(NETLIBHTTPREQUEST);
+ nlhr->requestType =requestType;
+ nlhr->flags =NLHRF_HTTP11;
+ nlhr->szUrl =url;
+ nlhr->headersCount =3;
+ nlhr->headers =(NETLIBHTTPHEADER*)mir_alloc(sizeof(NETLIBHTTPHEADER)*nlhr->headersCount);
+ {
+ char* contenttype=(char*)mir_alloc(sizeof(char)*(30+1+sizeof(boundary)));
+ memcpy(contenttype,"multipart/form-data; boundary=",30);
+ memcpy(contenttype+30,boundary,sizeof(boundary));
+ contenttype[30+sizeof(boundary)]='\0';
+ nlhr->headers[0].szName ="Content-Type";
+ nlhr->headers[0].szValue =contenttype;
+ nlhr->headers[1].szName ="User-Agent";
+ nlhr->headers[1].szValue =__USER_AGENT_STRING;
+ nlhr->headers[2].szName ="Accept-Language";
+ nlhr->headers[2].szValue ="en-us,en;q=0.8";
+// nlhr->headers[3].szName ="Referer";
+// nlhr->headers[3].szValue ="http://www.imageshack.us/upload_api.php";
+ }
+ char* dataPos=nlhr->pData;
+ size_t dataMax=0;
+ for(HTTPFormData* iter=frm,* end=frm+frmNum; iter!=end; ++iter){
+ HTTPFormAppendData(nlhr,&dataMax,&dataPos,NULL,2+sizeof(boundary)+40);
+ memset(dataPos,'-',2); dataPos+=2;
+ memcpy(dataPos,boundary,sizeof(boundary)); dataPos+=sizeof(boundary);
+ memcpy(dataPos,"\r\nContent-Disposition: form-data; name=\"",40); dataPos+=40;
+ size_t namelen=strlen(iter->name), valuelen=strlen(iter->value);
+ if(iter->flags&HTTPFORM_FILE){
+ const char* filename =strrchr(iter->value,'\\');
+ if(!filename) filename =strrchr(iter->value,'/');
+ if(!filename) filename =iter->value;
+ else ++filename;
+ valuelen=strlen(filename);
+ HTTPFormAppendData(nlhr,&dataMax,&dataPos,NULL,namelen+13+valuelen+17);
+ memcpy(dataPos,iter->name,namelen); dataPos+=namelen;
+ memcpy(dataPos,"\"; filename=\"",13); dataPos+=13;
+ memcpy(dataPos,filename,valuelen); dataPos+=valuelen;
+ memcpy(dataPos,"\"\r\nContent-Type: ",17); dataPos+=17;
+ /// add mime type
+ const char* mime="application/octet-stream";
+ const char* fileext=strrchr(filename,'.');
+ if(fileext){
+ if(!strcmp(fileext,".jpg") || !strcmp(fileext,".jpeg") || !strcmp(fileext,".jpe"))
+ mime="image/jpeg";
+ else if(!strcmp(fileext,".bmp"))
+ mime="image/bmp";
+ else if(!strcmp(fileext,".png"))
+ mime="image/png";
+ else if(!strcmp(fileext,".gif"))
+ mime="image/gif";
+ else if(!strcmp(fileext,".tif") || !strcmp(fileext,".tiff"))
+ mime="image/tiff";
+ }
+ HTTPFormAppendData(nlhr,&dataMax,&dataPos,mime,strlen(mime));
+ HTTPFormAppendData(nlhr,&dataMax,&dataPos,"\r\n\r\n",4);
+ /// add file content
+ size_t filesize=0;
+ FILE* fp=fopen(iter->value,"rb");
+ if(fp){
+ fseek(fp,0,SEEK_END);
+ filesize=ftell(fp); fseek(fp,0,SEEK_SET);
+ HTTPFormAppendData(nlhr,&dataMax,&dataPos,NULL,filesize+2);
+ if(fread(dataPos,1,filesize,fp)!=filesize){
+ fclose(fp), fp=NULL;
+ }
+ }
+ if(!fp){
+ HTTPFormDestroy(nlhr);
+ Error(_T("Error occurred when opening local file.\nAborting file upload..."));
+ Exit(ACKRESULT_FAILED);
+ return 1;
+ }else
+ fclose(fp);
+ dataPos+=filesize;
+ memcpy(dataPos,"\r\n",2); dataPos+=2;
+ }else if(iter->flags&HTTPFORM_8BIT){
+ HTTPFormAppendData(nlhr,&dataMax,&dataPos,NULL,namelen+38+valuelen+2);
+ memcpy(dataPos,iter->name,namelen); dataPos+=namelen;
+ memcpy(dataPos,"\"\r\nContent-Transfer-Encoding: 8bit\r\n\r\n",38); dataPos+=38;
+ memcpy(dataPos,iter->value,valuelen); dataPos+=valuelen;
+ memcpy(dataPos,"\r\n",2); dataPos+=2;
+ }else{
+ HTTPFormAppendData(nlhr,&dataMax,&dataPos,NULL,namelen+5+valuelen+2);
+ memcpy(dataPos,iter->name,namelen); dataPos+=namelen;
+ memcpy(dataPos,"\"\r\n\r\n",5); dataPos+=5;
+ memcpy(dataPos,iter->value,valuelen); dataPos+=valuelen;
+ memcpy(dataPos,"\r\n",2); dataPos+=2;
+ }
+ }
+ HTTPFormAppendData(nlhr,&dataMax,&dataPos,NULL,2+sizeof(boundary)+4);
+ memset(dataPos,'-',2); dataPos+=2;
+ memcpy(dataPos,boundary,sizeof(boundary)); dataPos+=sizeof(boundary);
+ memcpy(dataPos,"--\r\n",4); dataPos+=4;
+ nlhr->dataLength=dataPos-nlhr->pData;
+ #ifdef _DEBUG /// print request content to "_sendss_tmp" file for debugging
+ {
+ FILE* fp=fopen("_sendss_tmp","wb");
+ if(fp){
+ fprintf(fp,"--Target-- %s\n",nlhr->szUrl);
+ for(int i=0; i<nlhr->headersCount; ++i){
+ fprintf(fp,"%s: %s\n",nlhr->headers[i].szName,nlhr->headers[i].szValue);
+ }
+ fprintf(fp,"\n\n");
+ fwrite(nlhr->pData,1,nlhr->dataLength,fp);
+ fclose(fp);
+ }
+ }
+ #endif // _DEBUG
+ return 0;
+}
diff --git a/plugins/SendScreenshotPlus/src/CSend.h b/plugins/SendScreenshotPlus/src/CSend.h
index 77b0d677e9..fdf84d712b 100644
--- a/plugins/SendScreenshotPlus/src/CSend.h
+++ b/plugins/SendScreenshotPlus/src/CSend.h
@@ -99,6 +99,21 @@ class CSend {
void DB_EventAdd(WORD EventType);
static INT_PTR CALLBACK ResultDialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
+
+ /// HTTP upload helper stuff
+ enum HTTPFormFlags{
+ HTTPFORM_TEXT=0x00,
+ HTTPFORM_8BIT=0x01,
+ HTTPFORM_FILE=0x02,
+ };
+ struct HTTPFormData{
+ const char* name;
+ const char* value;
+ int flags;
+ };
+ static const char* GetHTMLContent(char* str, const char* startTag, const char* endTag); /// changes "str", can be successfully used only once
+ void HTTPFormDestroy(NETLIBHTTPREQUEST* nlhr); /// use to free data inside "nlhr" created by HTTPFormCreate
+ int HTTPFormCreate(NETLIBHTTPREQUEST* nlhr,int requestType,char* url,HTTPFormData* frm,size_t frmNum); /// returns "0" on success, Exit() will be called on failure (stop processing)
};
#endif
diff --git a/plugins/SendScreenshotPlus/src/CSendImageShack.cpp b/plugins/SendScreenshotPlus/src/CSendImageShack.cpp
index 84c57e0274..f6141651c2 100644
--- a/plugins/SendScreenshotPlus/src/CSendImageShack.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendImageShack.cpp
@@ -34,19 +34,9 @@ CSendImageShack::CSendImageShack(HWND Owner, MCONTACT hContact, bool bAsync)
: CSend(Owner, hContact, bAsync) {
m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND;
m_pszSendTyp = LPGENT("Image upload");
- m_pszFileName = NULL;
- m_pszContentType = NULL;
- m_MFDRboundary = NULL;
- m_nlreply = NULL;
- m_Url = NULL;
}
CSendImageShack::~CSendImageShack(){
- mir_free(m_pszFileName);
- mir_free(m_MFDRboundary);
- // FREEHTTPREQUESTSTRUCT*
- if (m_nlreply) CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM) m_nlreply);
- mir_free(m_Url);
};
//---------------------------------------------------------------------------
@@ -56,123 +46,19 @@ int CSendImageShack::Send() {
Exit(ACKRESULT_FAILED);
return !m_bAsync;
}
- if (!m_pszFileName) {
- m_pszFileName = GetFileNameA(m_pszFile);
- }
- if (!m_pszContentType) GetContentType();
-
- // create new boundary
- MFDR_Reset();
-
- // initialize the netlib request
ZeroMemory(&m_nlhr, sizeof(m_nlhr));
- m_nlhr.cbSize = sizeof(m_nlhr);
- m_nlhr.requestType = REQUEST_POST;
- m_nlhr.flags = NLHRF_HTTP11; //NLHRF_DUMPASTEXT;
- m_nlhr.szUrl = "http://www.imageshack.us/upload_api.php";
- m_nlhr.headersCount = 6;
- { //NETLIBHTTPHEADER start
- m_nlhr.headers=(NETLIBHTTPHEADER*)mir_alloc(sizeof(NETLIBHTTPHEADER)*m_nlhr.headersCount);
- m_nlhr.headers[0].szName = "Referer";
- m_nlhr.headers[0].szValue = "http://www.imageshack.us/upload_api.php";
- m_nlhr.headers[1].szName = "Connection";
- m_nlhr.headers[1].szValue = "Keep-alive";
- m_nlhr.headers[2].szName = "AcceptLanguage";
- m_nlhr.headers[2].szValue = "en-us, pt-br";
- m_nlhr.headers[3].szName = "Host";
- m_nlhr.headers[3].szValue = "imageshack.us";
- m_nlhr.headers[4].szName = "User-Agent";
- m_nlhr.headers[4].szValue = __USER_AGENT_STRING; //szAgent; /;
- //nlhr.headers[x].szName = "Authorization";
- //nlhr.headers[x].szValue = auth; //Basic base-64-authorization
-
- //$header .= "Content-type: multipart/form-data; boundary=" . part::getBoundary() . "\r\n";
- mir_snprintf(m_nlheader_ContentType, SIZEOF(m_nlheader_ContentType), "multipart/form-data; boundary=%s", m_MFDRboundary);
- m_nlhr.headers[m_nlhr.headersCount-1].szName = "Content-Type";
- m_nlhr.headers[m_nlhr.headersCount-1].szValue = m_nlheader_ContentType;
- } //NETLIBHTTPHEADER end
-
-//POST DATA file-header, init DATA with MultipartFormDataRequest
- //$params[] = new filepart('fileupload', $file, basename($file), $contentType, 'iso-8859-1');
- //($this->sendStart($h);)
- AppendToData("--");
- AppendToData(m_MFDRboundary);
- AppendToData("\r\n");
- //($this->sendDispositionHeader($h);)
- AppendToData("Content-Disposition: form-data; name=\"");
- AppendToData("fileupload");
- AppendToData("\"; filename=\"");
- AppendToData(m_pszFileName);
- AppendToData("\"");
- AppendToData("\r\n");
- //($this->sendContentTypeHeader($h);)
- AppendToData("Content-Type: ");
- AppendToData(m_pszContentType);
- AppendToData("; charset=");
- AppendToData("iso-8859-1");
- //($this->sendEndOfHeader($h);)
- AppendToData("\r\n");
- AppendToData("\r\n");
- //Now we add the file binary ($this->sendData($h))
- FILE * fileId = _tfsopen(m_pszFile, _T("rb"), _SH_DENYWR );
- if( !fileId) {
- Error(SS_ERR_INIT, m_pszSendTyp);
- Exit(ACKRESULT_FAILED);
+ char* tmp; tmp=mir_t2a(m_pszFile);
+ HTTPFormData frm[]={
+ {"fileupload",tmp,HTTPFORM_FILE},
+ //{"rembar","yes"},// no info bar on thumb
+ {"public","no"},
+ {"key",DEVKEY_IMAGESHACK,HTTPFORM_8BIT},
+ };
+ int error=HTTPFormCreate(&m_nlhr,REQUEST_POST,"http://imageshack.us/upload_api.php",frm,sizeof(frm)/sizeof(HTTPFormData));
+ mir_free(tmp);
+ if(error)
return !m_bAsync;
- }
- fseek(fileId, NULL, SEEK_END);
- size_t lenFile = ftell(fileId);
- size_t sizeDest = sizeof(char)*(m_nlhr.dataLength + lenFile + 1);
- m_nlhr.pData = (char *) mir_realloc(m_nlhr.pData, sizeDest);
- fseek(fileId, NULL, SEEK_SET );
- int i;
- int ch = fgetc( fileId );
- for( i=0; (i < (int)lenFile ) && ( feof( fileId ) == 0 ); i++ ) {
- m_nlhr.pData[m_nlhr.dataLength+i] = (char)ch;
- ch = fgetc( fileId );
- }
- m_nlhr.pData[sizeDest-1] = 0; //NULL Termination for binary data
- m_nlhr.dataLength = (int)sizeDest - 1;
- fclose(fileId);
- //($this->sendEnd($h);)
- AppendToData("\r\n");
-
-//POST DATA footer (for "optimage", 1)
-//POST DATA footer (for "optsize", optsize)
-
-//POST DATA footer (for "tags", tags)
-//POST DATA footer (for "rembar", "yes" : "no")
-//POST DATA footer (for "public", "yes" : "no")
-//POST DATA footer (for "cookie", cookie)
-
-//POST DATA footer (for "key", DEVKEY_IMAGESHACK)
- //($this->sendStart($h);)
- AppendToData("--");
- AppendToData(m_MFDRboundary);
- AppendToData("\r\n");
- //($this->sendDispositionHeader($h);)
- AppendToData("Content-Disposition: form-data; name=\"");
- AppendToData("key");
- AppendToData("\"");
- //($this->sendTransferEncodingHeader($h); )
- AppendToData("\r\n");
- AppendToData("Content-Transfer-Encoding: ");
- AppendToData("8bit"); //??"binary"
- //($this->sendEndOfHeader($h);)
- AppendToData("\r\n");
- AppendToData("\r\n");
- //($this->sendData($h);)
- AppendToData(DEVKEY_IMAGESHACK);
- //($this->sendEnd($h);)
- AppendToData("\r\n");
-
-//POST DATA Exit
- //$postdata = "--" . part::getBoundary() . "--\r\n";
- AppendToData("--");
- AppendToData(m_MFDRboundary);
- AppendToData("--\r\n");
-
-//start upload thread
+ /// start upload thread
if(m_bAsync){
mir_forkthread(&CSendImageShack::SendThreadWrapper, this);
return 0;
@@ -183,24 +69,35 @@ int CSendImageShack::Send() {
void CSendImageShack::SendThread() {
//send DATA and wait for m_nlreply
- m_nlreply = (NETLIBHTTPREQUEST *) CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM) hNetlibUser, (LPARAM) &m_nlhr);
- mir_freeAndNil(m_nlhr.pData);
- mir_freeAndNil(m_nlhr.headers);
- if(m_nlreply){
- if( m_nlreply->resultCode >= 200 && m_nlreply->resultCode < 300 ){
- m_nlreply->pData[m_nlreply->dataLength] = 0;// make sure its null terminated
- const char* URL = NULL;
- URL = GetTagContent(m_nlreply->pData, "<image_link>", "</image_link>");
- if (URL && URL[0]!= NULL) {
- m_Url = mir_strdup(URL);
- if(m_bSilent)
- return;
- svcSendMsgExit(URL); return;
- }else{//check error mess from server
- TCHAR* err = mir_a2t(GetTagContent(m_nlreply->pData, "<error ", "</error>"));
- if (!err || !*err){//fallback to server response mess
- mir_freeAndNil(err);
- err = mir_a2t(m_nlreply->pData);
+ NETLIBHTTPREQUEST* reply=(NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUser, (LPARAM)&m_nlhr);
+ HTTPFormDestroy(&m_nlhr);
+ if(reply){
+ if(reply->resultCode>=200 && reply->resultCode<300){
+ reply->pData[reply->dataLength]='\0';/// make sure its null terminated
+ const char* url=NULL;
+ url=GetHTMLContent(reply->pData,"<image_link>","</image_link>");
+ if(url && *url){
+ mir_free(m_URL), m_URL=mir_strdup(url);
+ mir_free(m_URLthumb), m_URLthumb=mir_strdup(m_URL);
+ int extlen;
+ char* pos=strrchr(m_URLthumb,'.');
+ if(pos && (extlen=mir_strlen(pos))>2){
+ char* tmp=mir_strdup(pos);
+ memcpy(pos,".th",3);
+ memcpy(pos+3,tmp,extlen-3);
+ mir_stradd(m_URLthumb,tmp+extlen-3);
+ mir_free(tmp);
+ }else{
+ mir_freeAndNil(m_URLthumb);
+ }
+ svcSendMsgExit(url); return;
+ }else{/// check error mess from server
+ url=GetHTMLContent(reply->pData,"<error ","</error>");
+ TCHAR* err=NULL;
+ if(url) err=mir_a2t(url);
+ if (!err || !*err){/// fallback to server response mess
+ mir_free(err);
+ err=mir_a2t(reply->pData);
}
Error(_T("%s"),err);
mir_free(err);
@@ -208,8 +105,7 @@ void CSendImageShack::SendThread() {
}else{
Error(LPGENT("Upload server did not respond timely."));
}
- CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM) m_nlreply);
- m_nlreply = NULL;
+ CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT,0,(LPARAM)reply);
}else{
Error(SS_ERR_INIT, m_pszSendTyp);
}
@@ -219,61 +115,3 @@ void CSendImageShack::SendThread() {
void CSendImageShack::SendThreadWrapper(void * Obj) {
reinterpret_cast<CSendImageShack*>(Obj)->SendThread();
}
-
-//---------------------------------------------------------------------------
-void CSendImageShack::MFDR_Reset() {
- char Temp[64];
- DWORD dwBoundaryRand1 = GetTickCount();
- DWORD dwBoundaryRand2 = rand();
-
- mir_freeAndNil(m_MFDRboundary);
- mir_snprintf(Temp, SIZEOF(Temp), "B-O-U-N-D-A-R-Y%u%u", dwBoundaryRand1, dwBoundaryRand2);
- mir_stradd(m_MFDRboundary,Temp);
-}
-
-void CSendImageShack::GetContentType() {
- if (m_pszContentType) mir_freeAndNil(m_pszContentType);
- char* FileExtension = GetFileExtA(m_pszFile);
-
- if ((strcmp(FileExtension, ".jpeg")==0) || (strcmp(FileExtension, ".jpe")==0) || (strcmp(FileExtension ,".jpg")==0))
- m_pszContentType="image/jpeg";
- else if (strcmp(FileExtension, ".bmp")==0)
- m_pszContentType="image/bmp";
- else if (strcmp(FileExtension, ".png")==0)
- m_pszContentType="image/png";
- else if (strcmp(FileExtension, ".gif")==0)
- m_pszContentType="image/gif";
- else if ((strcmp(FileExtension, ".tif")==0) || (strcmp(FileExtension, ".tiff")==0))
- m_pszContentType="image/tiff";
- else
- m_pszContentType="application/octet-stream";
-
- mir_free(FileExtension);
- return;
-}
-
-void CSendImageShack::AppendToData(const char *pszVal) {
- if (!m_nlhr.pData) {
- m_nlhr.pData = mir_strdup(pszVal);
- m_nlhr.dataLength = (int)strlen(pszVal);
- }
- else {
- size_t lenVal = strlen(pszVal);
- size_t sizeNew = sizeof(char)*(m_nlhr.dataLength + lenVal + 1);
- m_nlhr.pData = (char*) mir_realloc(m_nlhr.pData, sizeNew);
-
- strcpy(m_nlhr.pData + sizeof(char)*m_nlhr.dataLength, pszVal);
- m_nlhr.pData[sizeNew-1] = 0;
- m_nlhr.dataLength = (int)sizeNew -1;
- }
-}
-
-//---------------------------------------------------------------------------
-const char * CSendImageShack::GetTagContent(char * pszSource, const char * pszTagStart, const char * pszTagEnd) {
- char * b = strstr(pszSource, pszTagStart);
- if (!b) return NULL;
- b += strlen(pszTagStart);
- char * e = strstr(b, pszTagEnd);
- if (e) *e = 0;
- return b;
-}
diff --git a/plugins/SendScreenshotPlus/src/CSendImageShack.h b/plugins/SendScreenshotPlus/src/CSendImageShack.h
index 06642ff47e..f32e1cd0b0 100644
--- a/plugins/SendScreenshotPlus/src/CSendImageShack.h
+++ b/plugins/SendScreenshotPlus/src/CSendImageShack.h
@@ -37,22 +37,9 @@ class CSendImageShack : public CSend {
~CSendImageShack();
int Send();
- char* GetURL(){return m_Url;};
protected:
- char* m_pszFileName;
NETLIBHTTPREQUEST m_nlhr;
- NETLIBHTTPREQUEST* m_nlreply;
- char m_nlheader_ContentType[64];
- char* m_Url;
-
- void AppendToData(const char *pszVal); //append to netlib DATA
- char* m_pszContentType; //hold mimeType (does not need free)
- void GetContentType(); //get mimeType
- const char * GetTagContent(char * pszSource, const char * pszTagStart, const char * pszTagEnd);
-
- char* m_MFDRboundary;
- void MFDR_Reset();
void SendThread();
static void SendThreadWrapper(void * Obj);
diff --git a/plugins/SendScreenshotPlus/src/version.h b/plugins/SendScreenshotPlus/src/version.h
index 15d8b73bde..0726fb855e 100644
--- a/plugins/SendScreenshotPlus/src/version.h
+++ b/plugins/SendScreenshotPlus/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 8
-#define __RELEASE_NUM 3
-#define __BUILD_NUM 1
+#define __RELEASE_NUM 4
+#define __BUILD_NUM 0
#include <stdver.h>
@@ -12,4 +12,4 @@
#define __AUTHOREMAIL "ing.u.horn@googlemail.com"
#define __AUTHORWEB "http://miranda-ng.org/p/SendSS/"
#define __COPYRIGHT "© 2010 Merlin, 2004-2006 Sergio Vieira Rolanski"
-#define __USER_AGENT_STRING __PLUGIN_NAME##" v"##__VERSION_STRING
+#define __USER_AGENT_STRING "SendSS/" __VERSION_STRING_DOTS