summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-18 11:47:05 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-18 11:47:05 +0000
commit81fe4a0a34e8e07305381e18e449246fef822673 (patch)
treef67d76b7531445e7a18e7f0975f76f66597e8f69 /protocols
parent1be97f17884f9046e6ab45d45ea327ef00a3d095 (diff)
sync
git-svn-id: http://svn.miranda-ng.org/main/trunk@469 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/JabberG/jabber.cpp4
-rw-r--r--protocols/JabberG/jabber_proxy.cpp38
2 files changed, 25 insertions, 17 deletions
diff --git a/protocols/JabberG/jabber.cpp b/protocols/JabberG/jabber.cpp
index ec417502f0..983ad4daea 100644
--- a/protocols/JabberG/jabber.cpp
+++ b/protocols/JabberG/jabber.cpp
@@ -2,7 +2,7 @@
Jabber Protocol Plugin for Miranda IM
Copyright ( C ) 2002-04 Santithorn Bunchua
-Copyright ( C ) 2005-11 George Hazan
+Copyright ( C ) 2005-12 George Hazan
Copyright ( C ) 2007 Maxim Mluhov
This program is free software; you can redistribute it and/or
@@ -57,7 +57,7 @@ PLUGININFOEX pluginInfo = {
szVersion,
"George Hazan, Maxim Mluhov, Victor Pavlychko, Artem Shpynov, Michael Stepura",
"ghazan@miranda-im.org",
- "(c) 2005-11 George Hazan, Maxim Mluhov, Victor Pavlychko, Artem Shpynov, Michael Stepura",
+ "(c) 2005-2012 George Hazan, Maxim Mluhov, Victor Pavlychko, Artem Shpynov, Michael Stepura",
"http://miranda-im.org",
UNICODE_AWARE,
0,
diff --git a/protocols/JabberG/jabber_proxy.cpp b/protocols/JabberG/jabber_proxy.cpp
index e6f7ef2f7b..c00b0b734c 100644
--- a/protocols/JabberG/jabber_proxy.cpp
+++ b/protocols/JabberG/jabber_proxy.cpp
@@ -100,25 +100,33 @@ int JabberHttpGatewayBegin( HANDLE /*hConn*/, NETLIBOPENCONNECTION* /*nloc*/ )
return 1;
}
-#if 0
-int icq_httpGatewayWrapSend( HANDLE hConn, PBYTE buf, int len, int flags, MIRANDASERVICE pfnNetlibSend )
+int JabberHttpGatewayWrapSend( HANDLE hConn, PBYTE buf, int len, int flags, MIRANDASERVICE pfnNetlibSend )
{
- icq_packet packet;
- int sendResult;
+ TCHAR* strb = mir_utf8decodeW(( char* )buf );
- packet.wLen = len;
- write_httphdr( &packet, HTTP_PACKETTYPE_FLAP );
- packString( &packet, buf, ( WORD )len );
- sendResult = Netlib_Send( hConn, packet.pData, packet.wLen, flags );
- mir_free( packet.pData );
- if ( sendResult <= 0 )
- return sendResult;
- if ( sendResult < 14 )
- return 0;
- return sendResult - 14;
+ TCHAR sid[25] = _T("");
+ unsigned __int64 rid = 0;
+
+ XmlNode hPayLoad( strb );
+ XmlNode body( _T("body"));
+ HXML hBody = body << XATTRI64( _T("rid"), rid++ ) << XATTR( _T("sid"), sid ) <<
+ XATTR( _T("xmlns"), _T( "http://jabber.org/protocol/httpbind" ));
+ xmlAddChild( hBody, hPayLoad );
+
+ TCHAR* str = xi.toString( hBody, NULL );
+
+ mir_free( strb );
+ char* utfStr = mir_utf8encodeT( str );
+ NETLIBBUFFER nlb = { utfStr, (int)strlen( utfStr ), flags };
+ int result = pfnNetlibSend(( WPARAM )hConn, ( LPARAM )&nlb);
+ mir_free( utfStr );
+ xi.freeMem( str );
+
+ return result;
}
-PBYTE icq_httpGatewayUnwrapRecv( NETLIBHTTPREQUEST *nlhr, PBYTE buf, int len, int *outBufLen, void *( *NetlibRealloc )( void *, size_t ))
+#if 0
+PBYTE JabberHttpGatewayUnwrapRecv( NETLIBHTTPREQUEST *nlhr, PBYTE buf, int len, int *outBufLen, void *( *NetlibRealloc )( void *, size_t ))
{
WORD wLen, wType;
PBYTE tbuf;