You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(107) |
May
(70) |
Jun
(85) |
Jul
(4) |
Aug
(10) |
Sep
(37) |
Oct
(56) |
Nov
(4) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
(26) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(22) |
Aug
|
Sep
(3) |
Oct
(7) |
Nov
|
Dec
|
From: libmsn <tr...@bd...> - 2005-02-06 12:12:38
|
IzE3OiBDb25uZWN0aW9uIHN1YmNsYXNzZXMgc2hvdWxkIHN0b3JlIHRoZWlyIGN1cnJlbnQgc3Rh dGUuCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCiAgICAgICBJZDogIDE3ICAgICAgICAgICAgICAgIHwg ICAgICBTdGF0dXM6ICBjbG9zZWQgICAgICAgICAgICAgICAgICANCkNvbXBvbmVudDogIE90aGVy ICAgICAgICAgICAgIHwgICAgTW9kaWZpZWQ6ICBNb24gRmViICA3IDAxOjEyOjMyIDIwMDUNCiBT ZXZlcml0eTogIEZlYXR1cmUgUmVxdWVzdHMgIHwgICBNaWxlc3RvbmU6ICAzLjEuMiAgICAgICAg ICAgICAgICAgICANCiBQcmlvcml0eTogIDEgICAgICAgICAgICAgICAgIHwgICAgIFZlcnNpb246 ICAzLjEgICAgICAgICAgICAgICAgICAgICANCiAgICBPd25lcjogIG1yb3dlICAgICAgICAgICAg IHwgICAgUmVwb3J0ZXI6ICBtcm93ZSAgICAgICAgICAgICAgICAgICANCi0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0KQ2hhbmdlcyAoYnkgYmRhc2gpOgoKICAqIHJlc29sdXRpb246ICA9PiBmaXhlZA0KICAq IHN0YXR1czogIGFzc2lnbmVkID0+IGNsb3NlZA0KCkNvbW1lbnQ6CgogVGhpcyBpcyBmaXhlZCBp biAzLjIuICBDdXJyZW50IGNvbm5lY3Rpb24gc3RhdGUgaXMgYXZhaWxhYmxlIHZpYSB0aGUNCiBj b25uZWN0aW9uU3RhdGUoKSBtZXRob2QuCgotLSAKVGlja2V0IFVSTDogPGh0dHA6Ly9saWJtc24u YmRhc2gubmV0Lm56L2Rldi90aWNrZXQvMTc+CmxpYm1zbiA8aHR0cDovL2xpYm1zbi5iZGFzaC5u ZXQubnovPgpBIGxpYnJhcnkgZm9yIHRoZSBNU04gTWVzc2VuZ2VyIHNlcnZpY2UsIHdyaXR0ZW4g aW4gQysrLg== |
From: <bd...@bd...> - 2005-02-06 06:55:38
|
Author: bdash Date: 2005-02-06 19:55:32 +1300 (Sun, 06 Feb 2005) New Revision: 340 Modified: branches/libmsn-3.2.x/msn/errorcodes.h Log: Update version number in documentation. Modified: branches/libmsn-3.2.x/msn/errorcodes.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-3.2.x/msn/errorcodes.h 2005-02-06 06:50:39 UTC (rev 3= 39) +++ branches/libmsn-3.2.x/msn/errorcodes.h 2005-02-06 06:55:32 UTC (rev 3= 40) @@ -27,7 +27,7 @@ #include <list> #include <msn/switchboardserver.h> =20 -/** \mainpage libmsn 3.0 Reference +/** \mainpage libmsn 3.2 Reference * * <code>libmsn</code> is a C++ library for Microsoft's MSN Messenger se= rvice. It * provides a high-level interface that allows an application to access = instant |
From: <bd...@bd...> - 2005-02-06 06:51:03
|
Author: bdash Date: 2005-02-06 19:50:39 +1300 (Sun, 06 Feb 2005) New Revision: 339 Modified: branches/libmsn-3.2.x/doc/overview.txt branches/libmsn-3.2.x/msn/errorcodes.h branches/libmsn-3.2.x/www/_template.html branches/libmsn-3.2.x/www/content/download.html Log: Fix up the rest of the URLs Modified: branches/libmsn-3.2.x/doc/overview.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-3.2.x/doc/overview.txt 2005-02-05 12:15:26 UTC (rev 3= 38) +++ branches/libmsn-3.2.x/doc/overview.txt 2005-02-06 06:50:39 UTC (rev 3= 39) @@ -46,7 +46,7 @@ =20 Communication with ``libmsn`` is done via an object-oriented ``API`` and= user-provided callback functions. An instance of a user-defined subclas= s of ``MSN::Callbacks`` should be passed to the ``NotificationServerConne= ction`` constructor. All callbacks are declared within `msn/externals.h`_= . All callbacks listed need to be defined, otherwise you will get linker= errors when you attempt to build your program. Many of the callbacks ca= n be defined as an empty function, but those listed under `Required Callb= acks`_ need to be implemented with the documented semantics. =20 -.. _msn/externals.h: http://libmsn.bluewire.org.nz/svn/branches/libmsn-3= .2.x/msn/externals.h +.. _msn/externals.h: http://libmsn.bdash.net.nz/svn/branches/libmsn-3.2.= x/msn/externals.h =20 =20 Core Classes Modified: branches/libmsn-3.2.x/msn/errorcodes.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-3.2.x/msn/errorcodes.h 2005-02-05 12:15:26 UTC (rev 3= 38) +++ branches/libmsn-3.2.x/msn/errorcodes.h 2005-02-06 06:50:39 UTC (rev 3= 39) @@ -32,10 +32,10 @@ * <code>libmsn</code> is a C++ library for Microsoft's MSN Messenger se= rvice. It * provides a high-level interface that allows an application to access = instant * messaging features with ease. For more information, please visit the - * <a href=3D'http://libmsn.bluewire.org.nz'><code>libmsn</code></a> hom= epage. + * <a href=3D'http://libmsn.bdash.net.nz'><code>libmsn</code></a> homepa= ge. * * It is recommended that you read the - * <a href=3D'http://libmsn.bluewire.org.nz/overview.php'>library overvi= ew</a> + * <a href=3D'http://libmsn.bdash.net.nz/overview.php'>library overview<= /a> * before reading the reference documentation. The library overview wil= l * familiarise you with the architecture and core data-types of <code>li= bmsn</code>, * and will make the reference documentation much more understandable. Modified: branches/libmsn-3.2.x/www/_template.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-3.2.x/www/_template.html 2005-02-05 12:15:26 UTC (rev= 338) +++ branches/libmsn-3.2.x/www/_template.html 2005-02-06 06:50:39 UTC (rev= 339) @@ -41,7 +41,7 @@ </div> </div> <div id=3D'pagefooter' <?php if(! $documentation) echo "class=3D= 'shortpage'";?> > - Design copyright © 2004 <a href=3D'http://bdash.bluewir= e.net.nz'>Mark Rowe</a>. + Design copyright © 2004 <a href=3D'http://bdash.net.nz'= >Mark Rowe</a>. </div> =20 </body> Modified: branches/libmsn-3.2.x/www/content/download.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-3.2.x/www/content/download.html 2005-02-05 12:15:26 U= TC (rev 338) +++ branches/libmsn-3.2.x/www/content/download.html 2005-02-06 06:50:39 U= TC (rev 339) @@ -7,7 +7,7 @@ </p> =20 <h2>Bleeding Edge Code</h2> -<p>The latest bleeding-edge code is also available in a <a href=3D'http:= //subversion.tigris.org'>Subversion</a> repository at <code>http://libmsn= .bluewire.org.nz/svn/trunk/</code>. The repository is <a href=3D'http://= libmsn.bdash.net.nz/dev/browser/'>browseable</a> via <acronym title=3D'Hy= pertext Transfer Protocol'>HTTP</acronym>.</p> +<p>The latest bleeding-edge code is also available in a <a href=3D'http:= //subversion.tigris.org'>Subversion</a> repository at <code>http://libmsn= .bdash.net.nz/svn/trunk/</code>. The repository is <a href=3D'http://lib= msn.bdash.net.nz/dev/browser/'>browseable</a> via <acronym title=3D'Hyper= text Transfer Protocol'>HTTP</acronym>.</p> =20 <p> The code can be checked out of the Subversion repository by running th= e following command in your shell: |
From: <bd...@bd...> - 2005-02-05 12:15:30
|
Author: bdash Date: 2005-02-06 01:15:26 +1300 (Sun, 06 Feb 2005) New Revision: 338 Modified: branches/libmsn-3.2.x/www/_template.html branches/libmsn-3.2.x/www/content/index.html Log: Small HTML fixes. Modified: branches/libmsn-3.2.x/www/_template.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-3.2.x/www/_template.html 2005-02-05 11:46:46 UTC (rev= 337) +++ branches/libmsn-3.2.x/www/_template.html 2005-02-05 12:15:26 UTC (rev= 338) @@ -34,7 +34,6 @@ =20 <h2>Thanks To</h2> <a href=3D"http://sourceforge.net" style=3D'display: bl= ock;'><img src=3D"http://sourceforge.net/sflogo.php?group_id=3D106043&= ;type=3D1" width=3D"88" height=3D"31" border=3D"0" alt=3D"SourceForge.net= Logo" /></a> - <a href=3D'http://www.bluewire.net.nz/' style=3D'displa= y: block; padding-top: 5px;'><img src=3D'http://www.bluewire.net.nz/image= s/bluewire_logo_small.gif' width=3D'88' border=3D'0' /></a> </div> =20 <div id=3D'content'> Modified: branches/libmsn-3.2.x/www/content/index.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-3.2.x/www/content/index.html 2005-02-05 11:46:46 UTC = (rev 337) +++ branches/libmsn-3.2.x/www/content/index.html 2005-02-05 12:15:26 UTC = (rev 338) @@ -15,9 +15,9 @@ <h2>News</h2> <dl> <dt>Sunday 6 February, 00:30 NZDT</dt> - <dd>With the release of <code>libmsn 3.2</code> come= s support for multiple simultaneous connections. + <dd><p>With the release of <code>libmsn 3.2</code> c= omes support for multiple simultaneous connections. The callback mechanism has been refactored so th= at it is easy to distinguish between each connection's - callbacks. A large number of bug fixes have als= o been rolled in to this release. + callbacks. A large number of bug fixes have als= o been rolled in to this release.</p> </dd> <dt>Sunday 6 June, 4:11 NZDT</dt> <dd><p><code>libmsn</code> 3.1.1 is now available. = It is primarily a bug fix release. Changes include fixing up the |
From: <bd...@bd...> - 2005-02-05 11:46:53
|
Author: bdash Date: 2005-02-06 00:46:46 +1300 (Sun, 06 Feb 2005) New Revision: 337 Modified: branches/libmsn-3.2.x/www/content/download.html Log: Not using SF. Modified: branches/libmsn-3.2.x/www/content/download.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-3.2.x/www/content/download.html 2005-02-05 11:39:27 U= TC (rev 336) +++ branches/libmsn-3.2.x/www/content/download.html 2005-02-05 11:46:46 U= TC (rev 337) @@ -1,6 +1,6 @@ <h1>Download <code>libmsn</code></h1> <p> - The most recent release of <code>libmsn</code> is version 3.2. It is a= vailable from the <a href=3D'https://sourceforge.net/project/showfiles.ph= p?group_id=3D106043'>Sourceforge download page</a>. Documentation for th= is release may be found on this website, and is also included in the down= load. For support with using <code>libmsn</code>, please see the <a href= =3D'https://sourceforge.net/mail/?group_id=3D106043'>mailing lists</a> th= at Sourceforge hosts, or join the <acronym title=3D'Internet Relay Chat'>= IRC</acronym> channel <code>#libmsn</code> on <code>irc.freenode.net</cod= e>.</p> + The most recent release of <code>libmsn</code> is version 3.2. It is a= vailable for <a href=3D'http://libmsn.bdash.net.nz/files/libmsn-3.2.tar.g= z'>download now</a>. Documentation for this release may be found on this= website, and is also included in the download. For support with using <= code>libmsn</code>, please see the <a href=3D'https://sourceforge.net/mai= l/?group_id=3D106043'>mailing lists</a> that Sourceforge hosts, or join t= he <acronym title=3D'Internet Relay Chat'>IRC</acronym> channel <code>#li= bmsn</code> on <code>irc.freenode.net</code>.</p> =20 <p> Releases made through Sourceforge are considered stable, and any bugs fo= und should be reported via the <a href=3D'http://libmsn.bdash.net.nz/dev/= newticket/'>bug tracking page</a>. If any features are lacking from the = latest release, feel free to file a <a href=3D'http://libmsn.bdash.net.nz= /dev/newticket/'>feature request</a>. |
From: <bd...@bd...> - 2005-02-05 11:39:48
|
Author: bdash Date: 2005-02-06 00:39:27 +1300 (Sun, 06 Feb 2005) New Revision: 336 Added: tags/libmsn-3.2/ Log: Tag the release. Copied: tags/libmsn-3.2 (from rev 335, branches/libmsn-3.2.x) |
From: <bd...@bd...> - 2005-02-05 11:34:49
|
Author: bdash Date: 2005-02-06 00:32:39 +1300 (Sun, 06 Feb 2005) New Revision: 335 Modified: branches/libmsn-3.2.x/www/content/download.html branches/libmsn-3.2.x/www/content/index.html Log: Update webpages. Modified: branches/libmsn-3.2.x/www/content/download.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-3.2.x/www/content/download.html 2005-02-05 07:20:41 U= TC (rev 334) +++ branches/libmsn-3.2.x/www/content/download.html 2005-02-05 11:32:39 U= TC (rev 335) @@ -1,20 +1,19 @@ <h1>Download <code>libmsn</code></h1> <p> - The most recent release of <code>libmsn</code> is version 3.1. It is a= vailable from the <a href=3D'https://sourceforge.net/project/showfiles.ph= p?group_id=3D106043'>Sourceforge download page</a>. Documentation for th= is release may be found on this website, and is also included in the down= load. For support with using <code>libmsn</code>, please see the <a href= =3D'https://sourceforge.net/mail/?group_id=3D106043'>mailing lists</a> th= at Sourceforge hosts, or join <code>#libmsn</code> on <code>irc.freenode.= net</code>.</p> + The most recent release of <code>libmsn</code> is version 3.2. It is a= vailable from the <a href=3D'https://sourceforge.net/project/showfiles.ph= p?group_id=3D106043'>Sourceforge download page</a>. Documentation for th= is release may be found on this website, and is also included in the down= load. For support with using <code>libmsn</code>, please see the <a href= =3D'https://sourceforge.net/mail/?group_id=3D106043'>mailing lists</a> th= at Sourceforge hosts, or join the <acronym title=3D'Internet Relay Chat'>= IRC</acronym> channel <code>#libmsn</code> on <code>irc.freenode.net</cod= e>.</p> =20 <p> -Releases made through Sourceforge are considered stable, and any bugs fo= und should be reported via the <a href=3D'https://sourceforge.net/tracker= /?group_id=3D106043&atid=3D643054'>bug tracking page</a>. If any feature= s are lacking from the latest release, feel free to file a <a href=3D'htt= ps://sourceforge.net/tracker/?group_id=3D106043&atid=3D643057'>feature re= quest</a>. +Releases made through Sourceforge are considered stable, and any bugs fo= und should be reported via the <a href=3D'http://libmsn.bdash.net.nz/dev/= newticket/'>bug tracking page</a>. If any features are lacking from the = latest release, feel free to file a <a href=3D'http://libmsn.bdash.net.nz= /dev/newticket/'>feature request</a>. </p> =20 <h2>Bleeding Edge Code</h2> -<p>The latest bleeding-edge code is also available in a <a href=3D'http:= //subversion.tigris.org'>Subversion</a> repository at <code>http://libmsn= .bluewire.org.nz/svn/trunk/</code>. The repository is <a href=3D'http://= libmsn.bluewire.org.nz/svn/trunk/'>browseable</a> via <acronym title=3D'H= ypertext Transfer Protocol'>HTTP</acronym>. Big thanks to <a href=3D'htt= p://www.bluewire.net.nz'>Bluewire Solutions</a> for hosting the repositor= y. -</p> +<p>The latest bleeding-edge code is also available in a <a href=3D'http:= //subversion.tigris.org'>Subversion</a> repository at <code>http://libmsn= .bluewire.org.nz/svn/trunk/</code>. The repository is <a href=3D'http://= libmsn.bdash.net.nz/dev/browser/'>browseable</a> via <acronym title=3D'Hy= pertext Transfer Protocol'>HTTP</acronym>.</p> =20 <p> The code can be checked out of the Subversion repository by running th= e following command in your shell: </p> <pre class=3D'code'> -% svn co http://libmsn.bluewire.org.nz/svn/trunk libmsn +% svn co http://libmsn.bdash.net.nz/svn/trunk libmsn </pre> <p> The code will be placed inside a newly-created <code>libmsn</code> dir= ectory. For more information about Subversion, please see the free onlin= e book <a href=3D'http://svnbook.red-bean.com/'>Version Control with Subv= ersion</a>. Modified: branches/libmsn-3.2.x/www/content/index.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-3.2.x/www/content/index.html 2005-02-05 07:20:41 UTC = (rev 334) +++ branches/libmsn-3.2.x/www/content/index.html 2005-02-05 11:32:39 UTC = (rev 335) @@ -14,8 +14,17 @@ =20 <h2>News</h2> <dl> + <dt>Sunday 6 February, 00:30 NZDT</dt> + <dd>With the release of <code>libmsn 3.2</code> come= s support for multiple simultaneous connections. + The callback mechanism has been refactored so th= at it is easy to distinguish between each connection's + callbacks. A large number of bug fixes have als= o been rolled in to this release. + </dd> + <dt>Sunday 6 June, 4:11 NZDT</dt> + <dd><p><code>libmsn</code> 3.1.1 is now available. = It is primarily a bug fix release. Changes include fixing up the + <code>#include</code>'s so that it compiles cleanly = on a wider range of platforms, working file transfer support + and improved error handling.</p></dd> <dt>Monday 26 April, 2:20 NZDT</dt> - <dd><p><code>libmsn</code> 3.1 is now available. li= bmsn 3.1 brings support for server-side groups for managing=20 + <dd><p><code>libmsn</code> 3.1 is now available. <c= ode>libmsn</code> 3.1 brings support for server-side groups for managing=20 buddies. It also features rewritten network= code that should help reduce CPU usage, and the amount of time spent waiting for network data.</p> =20 |
From: <bd...@bd...> - 2005-02-05 07:20:55
|
Author: bdash Date: 2005-02-05 20:20:41 +1300 (Sat, 05 Feb 2005) New Revision: 334 Modified: branches/libmsn-3.2.x/README branches/libmsn-3.2.x/configure.ac branches/libmsn-3.2.x/doc/overview.txt Log: Update documentation to match current version + API changes. Modified: branches/libmsn-3.2.x/README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-3.2.x/README 2005-02-05 07:00:58 UTC (rev 333) +++ branches/libmsn-3.2.x/README 2005-02-05 07:20:41 UTC (rev 334) @@ -1,5 +1,5 @@ -libmsn 3.1 -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +libmsn 3.2 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 :Author: Mark Rowe :Contact: bd...@us... @@ -12,6 +12,13 @@ =20 Whats New? ---------- +In 3.2: With the release of libmsn 3.2 comes support for multiple sim= ultaneous connections. The + callback mechanism has been refactored so that it is easy to = distinguish between each + connection's callbacks. A large number of bug fixes have als= o been rolled in to this + release. +In 3.1.1: libmsn 3.1.1 is primarily a bug fix release. Changes include= fixing up the #include's + so that it compiles cleanly on a wider range of platforms, wo= rking file transfer + support and improved error handling. In 3.1: libmsn 3.1 brings support for server-side groups for managing= buddies. It also features rewritten network code that should help reduce CPU u= sage, and the amount of time spent waiting for network data. Modified: branches/libmsn-3.2.x/configure.ac =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-3.2.x/configure.ac 2005-02-05 07:00:58 UTC (rev 333) +++ branches/libmsn-3.2.x/configure.ac 2005-02-05 07:20:41 UTC (rev 334) @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. =20 AC_PREREQ(2.57) -AC_INIT(libmsn, 3.1, bd...@us...) -AM_INIT_AUTOMAKE(libmsn, 3.1) +AC_INIT(libmsn, 3.2, bd...@us...) +AM_INIT_AUTOMAKE(libmsn, 3.2) AC_CONFIG_SRCDIR([msn/md5.c]) AM_CONFIG_HEADER([config.h]) =20 Modified: branches/libmsn-3.2.x/doc/overview.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-3.2.x/doc/overview.txt 2005-02-05 07:00:58 UTC (rev 3= 33) +++ branches/libmsn-3.2.x/doc/overview.txt 2005-02-05 07:20:41 UTC (rev 3= 34) @@ -9,7 +9,7 @@ =20 .. contents:: =20 -This document contains a high level overview of ``libmsn`` 3.1. ``libms= n`` 3.1 is based on Meredydd Luff's ``libmsn`` 2.1, but is closer to a co= mplete rewrite than a new version. +This document contains a high level overview of ``libmsn`` 3.2. ``libms= n`` 3.2 is based on Meredydd Luff's ``libmsn`` 2.1, but is closer to a co= mplete rewrite than a new version. =20 ---------------------------------------- An Overview of the MSN Messenger System @@ -44,9 +44,9 @@ Communication with the Library =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =20 -Communication with ``libmsn`` is done via an object-oriented ``API`` and= a number of user-provided callback functions. All callbacks are declare= d within `msn/externals.h`_, and are within the ``MSN::ext`` namespace. = All callbacks listed need to be defined, otherwise you will get linker er= rors when you attempt to build your program. Many of the callbacks can b= e defined as an empty function, but those listed under `Required Callback= s`_ need to be implemented with the documented semantics. +Communication with ``libmsn`` is done via an object-oriented ``API`` and= user-provided callback functions. An instance of a user-defined subclas= s of ``MSN::Callbacks`` should be passed to the ``NotificationServerConne= ction`` constructor. All callbacks are declared within `msn/externals.h`_= . All callbacks listed need to be defined, otherwise you will get linker= errors when you attempt to build your program. Many of the callbacks ca= n be defined as an empty function, but those listed under `Required Callb= acks`_ need to be implemented with the documented semantics. =20 -.. _msn/externals.h: http://libmsn.bluewire.org.nz/svn/trunk/msn/externa= ls.h +.. _msn/externals.h: http://libmsn.bluewire.org.nz/svn/branches/libmsn-3= .2.x/msn/externals.h =20 =20 Core Classes @@ -77,13 +77,15 @@ struct pollfd mySockets[32]; int numberOfSockets =3D 0; MSN::NotificationServerConnection *mainConnection; + Callbacks cb; =20 mainConnection =3D new MSN::NotificationServerConnect("myP...@ex...",=20 - "myS3cr3t"); + "myS3cr3t", + cb); mainConnection->connect("messenger.hotmail.com", 1863); =20 - ``libmsn`` will then register and unregister sockets to be checked for= completed connections, available data, and writability by calling ``MSN:= :ext::registerSocket`` and ``MSN::ext::unregisterSocket`` one or more tim= es as is appropriate. + ``libmsn`` will then register and unregister sockets to be checked for= completed connections, available data, and writability by calling ``MSN:= :Callbacks::registerSocket`` and ``MSN::Callbacks::unregisterSocket`` one= or more times as is appropriate. =20 2. Enter your main event loop. This may be based on ``select``, ``poll`= `, or a similar ``API`` that will notify you when data is available on a = given socket:: =20 @@ -145,13 +147,13 @@ =20 The following callbacks are required by ``libmsn`` to implement the docu= mented semantics as they are used to integrate with your program: =20 -``int MSN::ext::connectToServer(std::string server, int port, bool *conn= ected)`` +``int MSN::Callbacks::connectToServer(std::string server, int port, bool= *connected)`` Return an integer containing a socket that has been connected to ser= ver:port. ``libmsn`` will call this when it wants to establish a connect= ion a computer named ``server`` that is listening on ``port``. The value= ``true`` should be stored in ``*connected`` if the connection has comple= ted, or ``false`` if the connection did not complete. ``-1`` should be r= eturned if an error occurs. =20 -``void MSN::ext::registerSocket(int socket, int reading, int writing)`` +``void MSN::Callbacks::registerSocket(int socket, int reading, int writi= ng)`` Called by ``libmsn`` to inform you which events you should watch for= on ``socket``. If ``reading`` is ``true``, then ``libmsn`` wishes to be= informed when data arrives on the socket. If ``writing`` is ``true``, `= `libmsn`` wishes to be informed when it is possible to write data to ``so= cket``. =20 -``void MSN::ext::unregisterSocket(int socket)`` +``void MSN::Callbacks::unregisterSocket(int socket)`` Called by ``libmsn`` to inform you that it no longer wishes to be no= tified of events relating to ``socket``. =20 Optional Callbacks @@ -177,20 +179,21 @@ void *requestContext =3D <some data>; mainConnection->requestSwitchboardConnection(requestContext); =20 -``MSN::ext::gotSwitchboard`` will be called when the requested switchboa= rd session is established. +``MSN::Callbacks::gotSwitchboard`` will be called when the requested swi= tchboard session is established. =20 =20 Inviting Buddies Into a Switchboard Session =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -Once you have established a switchboard session, you need to invite your= receiving buddy into the session. You can do this by using the ``Switch= boardServerConnection``'s ``inviteUser`` method. Note that the buddy is = not considered to have joined the session until ``MSN::ext::buddyJoinedCo= nversation`` has been called with the switchboard server and buddy as arg= uments. +Once you have established a switchboard session, you need to invite your= receiving buddy into the session. You can do this by using the ``Switch= boardServerConnection``'s ``inviteUser`` method. Note that the buddy is = not considered to have joined the session until ``MSN::Callbacks::buddyJo= inedConversation`` has been called with the switchboard server and buddy = as arguments. =20 Sending Instant Messages =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D =20 When your switchboard session has been established, and buddies invited,= you can then send an instant message. ``libmsn`` represents messages wi= th it's ``Message`` class, so an instance needs to be created that contai= ns the message that you wish to send. This instance will then allow you = to control such things as the font and color that the message will appear= in. The message can then be transmitted into the switchboard session by= using the ``SwitchboardServerConnection``'s ``sendMessage`` method:: =20 - MSN::SwitchboardServerConnection *theSwitchboard =3D <a switchboard = connection>; + MSN::SwitchboardServerConnection *theSwitchboard =3D + <a switchboard connection>; MSN::Message msg(myMessageText); msg.setFontName("Courier New"); msg.setFontEffects(MSN::Message::ITALIC_FONT); |
From: <bd...@bd...> - 2005-02-05 07:01:12
|
Author: bdash Date: 2005-02-05 20:00:58 +1300 (Sat, 05 Feb 2005) New Revision: 333 Added: branches/libmsn-3.2.x/ Log: Branch for 3.2.0 release. Copied: branches/libmsn-3.2.x (from rev 332, trunk) |
From: <bd...@bd...> - 2005-02-04 01:03:34
|
Author: bdash Date: 2005-02-04 14:03:20 +1300 (Fri, 04 Feb 2005) New Revision: 332 Modified: trunk/msn/connection.cpp trunk/msn/connection.h trunk/msn/filetransfer.cpp trunk/msn/filetransfer.h trunk/msn/notificationserver.cpp trunk/msn/notificationserver.h trunk/msn/switchboardserver.cpp trunk/msn/switchboardserver.h Log: Merge in lots of fixes from Fire's libmsn. Changes include more robust e= rror handling, the way we deal with trIDs, etc. Modified: trunk/msn/connection.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/msn/connection.cpp 2004-12-31 12:39:32 UTC (rev 331) +++ trunk/msn/connection.cpp 2005-02-04 01:03:20 UTC (rev 332) @@ -49,7 +49,7 @@ static std::vector<std::string> errors; =20 Connection::Connection()=20 - : sock(0), connected(false), trid(1), user_data(NULL) + : sock(0), connected(false), trID(1), user_data(NULL) { srand((unsigned int) time(NULL)); =20 @@ -121,7 +121,7 @@ this->sock =3D -1; this->writeBuffer.erase(); this->readBuffer.erase(); - this->trid =3D 0; + this->trID =3D 1; } =20 std::vector<std::string> Connection::getLine() @@ -148,8 +148,8 @@ this->connected =3D true; =20 // We know that we are connected, so this will try writing to th= e network. - this->write(this->writeBuffer, 1); - this->writeBuffer =3D ""; + size_t writtenLength =3D this->write(this->writeBuffer, 1); + this->writeBuffer =3D this->writeBuffer.substr(writtenLength); } =20 size_t Connection::write(std::string s, bool log) throw (std::runtim= e_error) @@ -175,7 +175,10 @@ written +=3D newWritten; } if (written !=3D s.size()) - throw std::runtime_error(strerror(errno)); + { + this->errorOnSocket(errno); + return written; + } } return s.size(); } @@ -184,7 +187,6 @@ { std::string s =3D ss.str(); size_t result =3D write(s, log); - ss.clear(); return result; =20 } =20 @@ -305,7 +307,7 @@ void Connection::showError(int errorCode) { std::ostringstream buf_; - buf_ << "An error has occurred while communicating with the MSN = Messenger server: " << errors[errorCode] << " (code " << errorCode << ")"= ; + buf_ << "Error code: " << errorCode << " (" << errors[errorCode]= << ")"; this->myNotificationServer()->externalCallbacks.showError(this, = buf_.str()); =20 } } Modified: trunk/msn/connection.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/msn/connection.h 2004-12-31 12:39:32 UTC (rev 331) +++ trunk/msn/connection.h 2005-02-04 01:03:20 UTC (rev 332) @@ -69,7 +69,7 @@ protected: /** The transaction ID of the next command to be sent. */ - int trid; + int trID; =20 std::string readBuffer; public:=20 @@ -144,6 +144,8 @@ /** Is this Connection connected to a remote endpoint? */ bool isConnected() { return this->connected; }; + virtual NotificationServerConnection *myNotificationServer() =3D= 0; =20 + protected: /** Process a @c <code>MSG</code> command. * @@ -154,8 +156,6 @@ void handle_MSG(std::vector<std::string> & args); =20 virtual void handleIncomingData() =3D 0; - virtual NotificationServerConnection *myNotificationServer() =3D= 0; - =20 private: std::string writeBuffer; static std::map<std::string, void (Connection::*)(std::vector<st= d::string> &, std::string, std::string)> messageHandlers; Modified: trunk/msn/filetransfer.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/msn/filetransfer.cpp 2004-12-31 12:39:32 UTC (rev 331) +++ trunk/msn/filetransfer.cpp 2005-02-04 01:03:20 UTC (rev 332) @@ -161,6 +161,13 @@ void FileTransferConnection::disconnect() { Connection::disconnect(); + =20 + if (this->auth.fd) + { + fclose(this->auth.fd); + this->auth.fd =3D NULL; + } + =20 this->auth.inv->switchboardConnection->removeFileTransferConnect= ion(this); delete this->auth.inv; this->auth.inv =3D NULL; @@ -254,7 +261,8 @@ =20 if (args[0] =3D=3D "VER") { - this->write("VER MSNFTP\r\n"); + if (this->write("VER MSNFTP\r\n") !=3D strlen("VER MSNFTP\r\= n")) + return; this->myNotificationServer()->externalCallbacks.fileTransfer= Progress(this->auth.inv, "Negotiating", 0, 0); } else if (args[0] =3D=3D "USR") @@ -313,7 +321,7 @@ blockHeader[1] =3D (blockLength >> 0) & 0xff; blockHeader[2] =3D (blockLength >> 8) & 0xff; =20 - if (this->write(std::string((char *) &blockHeader[bytesWritt= en], 3 - bytesWritten), false) < 0) + if (this->write(std::string((char *) &blockHeader[bytesWritt= en], 3 - bytesWritten), false) !=3D 3) { this->myNotificationServer()->externalCallbacks.fileTran= sferFailed(this->auth.inv, errno, strerror(errno)); goto cleanup; @@ -325,7 +333,7 @@ goto cleanup; } =20 - if (this->write(std::string((char *) readBuffer, blockLength= ), false) < 0) + if ((blockLength =3D this->write(std::string((char *) readBu= ffer, blockLength), false)) < 0) { this->myNotificationServer()->externalCallbacks.fileTran= sferFailed(this->auth.inv, errno, strerror(errno)); goto cleanup; @@ -340,28 +348,19 @@ this->auth.inv->switchboardConnection->invitationsSent.remove(th= is->auth.inv); if (readBuffer) free(readBuffer); + if (this->auth.fd) + { + fclose(this->auth.fd); + this->auth.fd =3D NULL; + } } =20 void FileTransferConnection::handleSend_Bye() { - if (! this->isWholeLineAvailable()) - return; - =20 - std::vector<std::string> args; this->myNotificationServer()->externalCallbacks.fileTransferSucc= eeded(this->auth.inv); =20 - args =3D this->getLine(); - this->readBuffer =3D this->readBuffer.substr(this->readBuffer.fi= nd("\r\n") + 2); - - if (args.size() > 0) - { - printf("%s", args[0].c_str()); - if (args.size() > 1) - printf(" %s", args[1].c_str()); - printf("\n"); - } - =20 - this->auth.inv->switchboardConnection->invitationsSent.remove(th= is->auth.inv); =20 + this->auth.inv->switchboardConnection->invitationsSent.remove(th= is->auth.inv); + this->disconnect(); } =20 =20 @@ -472,6 +471,11 @@ cleanup: ; this->auth.inv->switchboardConnection->invitationsReceived.remov= e(this->auth.inv); + if (this->auth.fd) + { + fclose(this->auth.fd); + this->auth.fd =3D NULL; + } } =20 void FileTransferInvitation::rejectTransfer() Modified: trunk/msn/filetransfer.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/msn/filetransfer.h 2004-12-31 12:39:32 UTC (rev 331) +++ trunk/msn/filetransfer.h 2005-02-04 01:03:20 UTC (rev 332) @@ -164,9 +164,9 @@ virtual void socketIsWritable(); virtual void socketConnectionCompleted(); virtual void dataArrivedOnSocket(); + virtual NotificationServerConnection *myNotificationServer() { r= eturn switchboardConnection()->myNotificationServer(); }; =20 protected: virtual void handleIncomingData(); - virtual NotificationServerConnection *myNotificationServer() { r= eturn switchboardConnection()->myNotificationServer(); }; private: void handleSend(); void handleReceive(); Modified: trunk/msn/notificationserver.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/msn/notificationserver.cpp 2004-12-31 12:39:32 UTC (rev 331) +++ trunk/msn/notificationserver.cpp 2005-02-04 01:03:20 UTC (rev 332) @@ -109,7 +109,7 @@ =20 const std::list<SwitchboardServerConnection *> & NotificationServerC= onnection::switchboardConnections() { - this->assertConnectionStateIsAtLeast(NS_CONNECTED); =20 + this->assertConnectionStateIsAtLeast(NS_CONNECTED); return _switchboardConnections; } =20 @@ -257,8 +257,9 @@ md5_finish(&state, digest); =20 std::ostringstream buf_; - buf_ << "QRY " << trid++ << " PROD0038W!61ZTF9 32\r\n"; - write(buf_); + buf_ << "QRY " << this->trID++ << " PROD0038W!61ZTF9 32\r\n"; + if (write(buf_) !=3D buf_.str().size()) + return; =20 =20 char hexdigest[3]; @@ -308,7 +309,7 @@ void NotificationServerConnection::handle_ADG(std::vector<std::strin= g> & args) { this->assertConnectionStateIsAtLeast(NS_CONNECTED); =20 - this->myNotificationServer()->externalCallbacks.addedGroup(this,= args[3], decimalFromString(args[4])); + this->myNotificationServer()->externalCallbacks.addedGroup(this,= decodeURL(args[3]), decimalFromString(args[4])); this->myNotificationServer()->externalCallbacks.gotLatestListSer= ial(this, decimalFromString(args[2])); } =20 @@ -322,7 +323,7 @@ void NotificationServerConnection::handle_REG(std::vector<std::strin= g> & args) { this->assertConnectionStateIsAtLeast(NS_CONNECTED); - this->myNotificationServer()->externalCallbacks.renamedGroup(thi= s, decimalFromString(args[3]), args[4]); + this->myNotificationServer()->externalCallbacks.renamedGroup(thi= s, decimalFromString(args[3]), decodeURL(args[4])); this->myNotificationServer()->externalCallbacks.gotLatestListSer= ial(this, decimalFromString(args[2])); } =20 @@ -331,7 +332,7 @@ { this->assertConnectionStateIsAtLeast(NS_CONNECTED); std::ostringstream buf_; - buf_ << "CHG " << trid++ << " " << buddyStatusToString(state) <<= " 0\r\n"; + buf_ << "CHG " << this->trID++ << " " << buddyStatusToString(sta= te) << " 0\r\n"; write(buf_); =20 } =20 @@ -339,7 +340,7 @@ { this->assertConnectionStateIsAtLeast(NS_CONNECTED); std::ostringstream buf_; - buf_ << "BLP " << trid++ << " " << setting << "L\r\n"; + buf_ << "BLP " << this->trID++ << " " << setting << "L\r\n"; write(buf_); =20 } =20 @@ -347,7 +348,7 @@ { this->assertConnectionStateIsAtLeast(NS_CONNECTED); std::ostringstream buf_; - buf_ << "GTC " << trid++ << " " << setting << "\r\n"; + buf_ << "GTC " << this->trID++ << " " << setting << "\r\n"; write(buf_); =20 } =20 @@ -358,7 +359,7 @@ throw std::runtime_error("Friendly name too long!"); =20 std::ostringstream buf_; =20 - buf_ << "REA " << trid++ << " " << this->auth.username << " " <<= encodeURL(friendlyName) << "\r\n"; + buf_ << "REA " << this->trID++ << " " << this->auth.username << = " " << encodeURL(friendlyName) << "\r\n"; write(buf_); =20 } =20 @@ -366,7 +367,7 @@ { this->assertConnectionStateIsAtLeast(NS_CONNECTED); std::ostringstream buf_; - buf_ << "ADD " << trid++ << " " << list << " " << buddyName << "= " << buddyName << "\r\n"; + buf_ << "ADD " << this->trID++ << " " << list << " " << buddyNam= e << " " << buddyName << "\r\n"; write(buf_); =20 } =20 @@ -374,7 +375,7 @@ { this->assertConnectionStateIsAtLeast(NS_CONNECTED); std::ostringstream buf_; - buf_ << "REM " << trid++ << " " << list << " " << buddyName << "= \r\n"; + buf_ << "REM " << this->trID++ << " " << list << " " << buddyNam= e << "\r\n"; write(buf_); =20 } =20 @@ -382,7 +383,7 @@ { this->assertConnectionStateIsAtLeast(NS_CONNECTED); std::ostringstream buf_; - buf_ << "ADD " << trid++ << " " << "FL" << " " << buddyName << "= " << buddyName << " " << groupID << "\r\n"; + buf_ << "ADD " << this->trID++ << " " << "FL" << " " << buddyNam= e << " " << buddyName << " " << groupID << "\r\n"; write(buf_); } =20 @@ -390,7 +391,7 @@ { this->assertConnectionStateIsAtLeast(NS_CONNECTED); std::ostringstream buf_; - buf_ << "REM " << trid++ << " " << "FL" << " " << buddyName << "= " << groupID << "\r\n"; + buf_ << "REM " << this->trID++ << " " << "FL" << " " << buddyNam= e << " " << groupID << "\r\n"; write(buf_); } =20 @@ -398,7 +399,7 @@ { this->assertConnectionStateIsAtLeast(NS_CONNECTED); std::ostringstream buf_; - buf_ << "ADG " << trid++ << " " << encodeURL(groupName) << " " <= < 0 << "\r\n"; + buf_ << "ADG " << this->trID++ << " " << encodeURL(groupName) <<= " " << 0 << "\r\n"; write(buf_); =20 } =20 @@ -406,7 +407,7 @@ { this->assertConnectionStateIsAtLeast(NS_CONNECTED); std::ostringstream buf_; - buf_ << "RMG " << trid++ << " " << groupID << "\r\n"; + buf_ << "RMG " << this->trID++ << " " << groupID << "\r\n"; write(buf_); } =20 @@ -414,7 +415,7 @@ { this->assertConnectionStateIsAtLeast(NS_CONNECTED); std::ostringstream buf_; - buf_ << "REG " << trid++ << " " << groupID << " " << encodeURL(n= ewGroupName) << " " << 0 << "\r\n"; + buf_ << "REG " << this->trID++ << " " << groupID << " " << encod= eURL(newGroupName) << " " << 0 << "\r\n"; write(buf_); } =20 @@ -426,11 +427,12 @@ ListSyncInfo *info =3D new ListSyncInfo(version); =20 std::ostringstream buf_; - buf_ << "SYN " << trid << " " << version << "\r\n"; - write(buf_); + buf_ << "SYN " << this->trID << " " << version << "\r\n"; + if (write(buf_) !=3D buf_.str().size()) + return; =20 - this->addCallback(&NotificationServerConnection::callback_SyncDa= ta, trid, (void *)info); - this->synctrid =3D trid++; + this->addCallback(&NotificationServerConnection::callback_SyncDa= ta, this->trID, (void *)info); + this->synctrid =3D this->trID++; this->setConnectionState(NS_SYNCHRONISING); } =20 @@ -442,12 +444,14 @@ =20 void NotificationServerConnection::requestSwitchboardConnection(cons= t void *tag) { - this->assertConnectionStateIsAtLeast(NS_CONNECTED); =20 + this->assertConnectionStateIsAtLeast(NS_CONNECTED); SwitchboardServerConnection::AuthData *auth =3D new SwitchboardS= erverConnection::AuthData(this->auth.username, tag); std::ostringstream buf_; - buf_ << "XFR " << trid << " SB\r\n"; - write(buf_); - this->addCallback(&NotificationServerConnection::callback_Transf= erToSwitchboard, trid++, (void *)auth); =20 + buf_ << "XFR " << this->trID << " SB\r\n"; + if (write(buf_) !=3D buf_.str().size()) + return; + =20 + this->addCallback(&NotificationServerConnection::callback_Transf= erToSwitchboard, this->trID++, (void *)auth); =20 } =20 template <class _Tp> @@ -481,10 +485,17 @@ void NotificationServerConnection::socketConnectionCompleted() { this->assertConnectionStateIs(NS_CONNECTING); + this->setConnectionState(NS_CONNECTED); + =20 Connection::socketConnectionCompleted(); - this->myNotificationServer()->externalCallbacks.unregisterSocket= (this->sock); - this->myNotificationServer()->externalCallbacks.registerSocket(t= his->sock, 1, 0); - this->setConnectionState(NS_CONNECTED); + =20 + // If an error occurs in Connection::socketConnectionCompleted, = we + // will be disconnected before we get here. + if (this->connectionState() !=3D NS_DISCONNECTED) + { + this->myNotificationServer()->externalCallbacks.unregisterSo= cket(this->sock); + this->myNotificationServer()->externalCallbacks.registerSock= et(this->sock, 1, 0); + } } =20 void NotificationServerConnection::connect(const std::string & hostn= ame, unsigned int port) @@ -504,9 +515,11 @@ this->socketConnectionCompleted(); =20 std::ostringstream buf_; - buf_ << "VER " << trid << " MSNP8\r\n"; - this->write(buf_); - this->addCallback(&NotificationServerConnection::callback_Negoti= ateCVR, trid++, (void *)info); + buf_ << "VER " << this->trID << " MSNP8\r\n"; + if (this->write(buf_) !=3D buf_.str().size()) + return; + =20 + this->addCallback(&NotificationServerConnection::callback_Negoti= ateCVR, this->trID++, (void *)info); } =20 void NotificationServerConnection::connect(const std::string & hostn= ame, unsigned int port, const Passport & username, const std::string & pa= ssword) @@ -548,9 +561,14 @@ while (this->isWholeLineAvailable()) { std::vector<std::string> args =3D this->getLine(); - if (args[0] =3D=3D "MSG" || args[0] =3D=3D "NOT") + if (args[0] =3D=3D "MSG" || args[0] =3D=3D "NOT" || args[0] = =3D=3D "IPG") { - int dataLength =3D decimalFromString(args[3]); + int dataLength; + if (args[0] =3D=3D "MSG") + dataLength =3D decimalFromString(args[3]); + else + dataLength =3D decimalFromString(args[1]); + if (this->readBuffer.find("\r\n") + 2 + dataLength > thi= s->readBuffer.size()) return; } @@ -619,7 +637,7 @@ } } =20 - if (!this->callbacks.empty() && trid > 0) + if (!this->callbacks.empty() && trid >=3D 0) { if (this->callbacks.find(trid) !=3D this->callbacks.end(= )) { @@ -755,9 +773,10 @@ } =20 std::ostringstream buf_; - buf_ << "CVR " << trid << " 0x0409 winnt 5.2 i386 MSNMSGR 6.0.02= 50 MSMSGS " << info->username << "\r\n"; - this->write(buf_); - this->addCallback(&NotificationServerConnection::callback_Reques= tUSR, trid++, (void *) data); + buf_ << "CVR " << this->trID << " 0x0409 winnt 5.2 i386 MSNMSGR = 6.0.0250 MSMSGS " << info->username << "\r\n"; + if (this->write(buf_) !=3D buf_.str().size()) + return; + this->addCallback(&NotificationServerConnection::callback_Reques= tUSR, this->trID++, (void *) data); } =20 void NotificationServerConnection::callback_TransferToSwitchboard(st= d::vector<std::string> & args, int trid, void *data) @@ -801,10 +820,11 @@ } =20 std::ostringstream buf_; - buf_ << "USR " << trid << " TWN I " << info->username << "\r\n"; - this->write(buf_); + buf_ << "USR " << this->trID << " TWN I " << info->username << "= \r\n"; + if (this->write(buf_) !=3D buf_.str().size()) + return; =20 - this->addCallback(&NotificationServerConnection::callback_Passpo= rtAuthentication, trid++, (void *) data); + this->addCallback(&NotificationServerConnection::callback_Passpo= rtAuthentication, this->trID++, (void *) data); } =20 =20 void NotificationServerConnection::callback_PassportAuthentication(s= td::vector<std::string> & args, int trid, void * data) @@ -899,9 +919,10 @@ } =20 std::ostringstream buf_; - buf_ << "USR " << trid << " TWN S " << info->cookie << "\r\n"; - this->write(buf_); - this->addCallback(&NotificationServerConnection::callback_Authen= ticationComplete, trid++, (void *) data); + buf_ << "USR " << this->trID << " TWN S " << info->cookie << "\r= \n"; + if (this->write(buf_) !=3D buf_.str().size()) + return; + this->addCallback(&NotificationServerConnection::callback_Authen= ticationComplete, this->trID++, (void *) data); } =20 void NotificationServerConnection::callback_AuthenticationComplete(s= td::vector<std::string> & args, int trid, void * data) @@ -922,8 +943,6 @@ =20 delete info; =20 - trid++; - =20 this->myNotificationServer()->externalCallbacks.gotNewConnection= (this); } =20 =20 Modified: trunk/msn/notificationserver.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/msn/notificationserver.h 2004-12-31 12:39:32 UTC (rev 331) +++ trunk/msn/notificationserver.h 2005-02-04 01:03:20 UTC (rev 332) @@ -286,10 +286,10 @@ =20 NotificationServerState connectionState() const { return this->_= connectionState; }; Callbacks & externalCallbacks; + virtual NotificationServerConnection *myNotificationServer() { r= eturn this; }; =20 protected: virtual void handleIncomingData(); NotificationServerState _connectionState; - virtual NotificationServerConnection *myNotificationServer() { r= eturn this; } =20 void setConnectionState(NotificationServerState s) { this->_conn= ectionState =3D s; }; void assertConnectionStateIs(NotificationServerState s) { assert= (this->_connectionState =3D=3D s); }; Modified: trunk/msn/switchboardserver.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/msn/switchboardserver.cpp 2004-12-31 12:39:32 UTC (rev 331) +++ trunk/msn/switchboardserver.cpp 2005-02-04 01:03:20 UTC (rev 332) @@ -153,7 +153,7 @@ std::string s =3D msg->asString(); =20 std::ostringstream buf_; - buf_ << "MSG " << trid++ << " N " << (int) s.size() << "\r\n" <<= s; + buf_ << "MSG " << this->trID++ << " A " << (int) s.size() << "\r= \n" << s; this->write(buf_); } =20 @@ -281,7 +281,7 @@ msg_ << "\r\n"; size_t msg_length =3D msg_.str().size(); =20 - buf_ << "MSG " << trid++ << " U " << (int) msg_length << "\r\n" = << msg_.str(); + buf_ << "MSG " << this->trID++ << " U " << (int) msg_length << "= \r\n" << msg_.str(); =20 write(buf_); =20 } @@ -290,7 +290,7 @@ { this->assertConnectionStateIsAtLeast(SB_WAITING_FOR_USERS); = =20 std::ostringstream buf_; - buf_ << "CAL " << trid++ << " " << userName << "\r\n"; + buf_ << "CAL " << this->trID++ << " " << userName << "\r\n"; write(buf_); =20 } =20 @@ -313,19 +313,21 @@ std::ostringstream buf_; if (this->auth.sessionID.empty()) { - buf_ << "USR " << trid << " " << this->auth.username << " " = << this->auth.cookie << "\r\n"; - this->write(buf_); - this->addCallback(&SwitchboardServerConnection::callback_Inv= iteUsers, trid, NULL); + buf_ << "USR " << this->trID << " " << this->auth.username <= < " " << this->auth.cookie << "\r\n"; + if (this->write(buf_) !=3D buf_.str().size()) + return; + this->addCallback(&SwitchboardServerConnection::callback_Inv= iteUsers, this->trID, NULL); }=20 else { - buf_ << "ANS " << trid << " " << this->auth.username << " " = << this->auth.cookie << " " << this->auth.sessionID << "\r\n"; - this->write(buf_); + buf_ << "ANS " << this->trID << " " << this->auth.username <= < " " << this->auth.cookie << " " << this->auth.sessionID << "\r\n"; + if (this->write(buf_) !=3D buf_.str().size()) + return; this->myNotificationServer()->externalCallbacks.gotNewConnec= tion(this); - this->addCallback(&SwitchboardServerConnection::callback_Ans= weredCall, trid, NULL); + this->addCallback(&SwitchboardServerConnection::callback_Ans= weredCall, this->trID, NULL); } =20 - trid++; =20 + this->trID++; =20 } =20 void SwitchboardServerConnection::disconnect() Modified: trunk/msn/switchboardserver.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/msn/switchboardserver.h 2004-12-31 12:39:32 UTC (rev 331) +++ trunk/msn/switchboardserver.h 2005-02-04 01:03:20 UTC (rev 332) @@ -145,11 +145,11 @@ }; =20 SwitchboardServerState connectionState() const { return this->_c= onnectionState; }; + virtual NotificationServerConnection *myNotificationServer() { r= eturn ¬ificationServer; }; =20 protected: virtual void handleIncomingData(); SwitchboardServerState _connectionState; - virtual NotificationServerConnection *myNotificationServer() { r= eturn ¬ificationServer; }; - =20 + void setConnectionState(SwitchboardServerState s) { this->_conne= ctionState =3D s; }; void assertConnectionStateIs(SwitchboardServerState s) { assert(= this->_connectionState =3D=3D s); }; void assertConnectionStateIsNot(SwitchboardServerState s) { asse= rt(this->_connectionState !=3D s); }; |
From: <bd...@bd...> - 2004-12-31 12:40:26
|
Author: bdash Date: 2005-01-01 01:39:32 +1300 (Sat, 01 Jan 2005) New Revision: 331 Modified: branches/libmsn-experimental/Makefile Log: Turn warnings on when building. Modified: branches/libmsn-experimental/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/Makefile 2004-12-20 01:38:38 UTC (rev 33= 0) +++ branches/libmsn-experimental/Makefile 2004-12-31 12:39:32 UTC (rev 33= 1) @@ -19,7 +19,7 @@ PYTHON_VERSION?=3D2.3 BOOST_BUILD=3D$(BOOST_ROOT)/tools/build/v1 =20 -BJAM_FLAGS=3D-sPYTHON_VERSION=3D$(PYTHON_VERSION) -sBOOST_BUILD=3D$(BOOS= T_BUILD) -sBOOST_ROOT=3D$(BOOST_ROOT) -sTOOLS=3D$(TOOLS) +BJAM_FLAGS=3D-sPYTHON_VERSION=3D$(PYTHON_VERSION) -sBOOST_BUILD=3D$(BOOS= T_BUILD) -sBOOST_ROOT=3D$(BOOST_ROOT) -sTOOLS=3D$(TOOLS) "-sBUILD=3D<warn= ings>on" ifdef PYTHON_ROOT BJAM_FLAGS+=3D -sPYTHON_ROOT=3D$(PYTHON_ROOT) endif |
From: <bd...@bd...> - 2004-12-20 01:38:47
|
Author: bdash Date: 2004-12-20 14:38:38 +1300 (Mon, 20 Dec 2004) New Revision: 330 Modified: branches/libmsn-experimental/msn/net/protocol.cpp Log: Uninitialized value. Modified: branches/libmsn-experimental/msn/net/protocol.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/protocol.cpp 2004-12-19 21:31:56= UTC (rev 329) +++ branches/libmsn-experimental/msn/net/protocol.cpp 2004-12-20 01:38:38= UTC (rev 330) @@ -85,7 +85,7 @@ this->_buffer +=3D data; unsigned int lastOffset =3D 0; std::string line; - bool f; + bool f =3D true; =20 while (this->_isLineMode) { |
From: <bd...@bd...> - 2004-12-19 21:32:00
|
Author: bdash Date: 2004-12-20 10:31:56 +1300 (Mon, 20 Dec 2004) New Revision: 329 Modified: branches/libmsn-experimental/msn/examples/simple_https.cpp Log: An example of multiple concurrent connections using a deferred to stop th= e reactor when needed. Modified: branches/libmsn-experimental/msn/examples/simple_https.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/examples/simple_https.cpp 2004-12-19= 21:23:27 UTC (rev 328) +++ branches/libmsn-experimental/msn/examples/simple_https.cpp 2004-12-19= 21:31:56 UTC (rev 329) @@ -2,13 +2,14 @@ #include <msn/net/transport.hpp> #include <msn/net/connector.hpp> #include <msn/net/reactor.hpp> +#include <msn/util/defer.hpp> =20 class MyLineReceiver : public MSN::Net::LineReceiverProtocol { public: MyLineReceiver() : MSN::Net::LineReceiverProtocol() {}; virtual ~MyLineReceiver() {}; - =20 + void connectionMade() { fprintf(stderr, "connectionMade\n"); @@ -40,6 +41,8 @@ F() : MSN::Net::ClientFactory() {}; virtual ~F() {}; =20 + MSN::util::Deferred deferred; + =20 virtual MSN::Net::Protocol * buildProtocol() { return new MyLineReceiver(); @@ -48,13 +51,13 @@ void clientConnectionLost(MSN::Net::TCPConnector & connector, co= nst MSN::Net::DisconnectReason & reason) { fprintf(stderr, "clientConnectionLost\n"); - MSN::Net::theReactor().stop(); + this->deferred.callback(1); } =20 void clientConnectionFailed(MSN::Net::TCPConnector & connector, = const MSN::Net::SocketError & reason) { fprintf(stderr, "clientConnectionFailed\n"); - MSN::Net::theReactor().stop(); + this->deferred.callback(1); } =20 void startedConnecting() @@ -63,9 +66,22 @@ } }; =20 +int numberDone =3D 0; +boost::any finished(const boost::any & arg) +{ + if (++numberDone =3D=3D 2) + { + MSN::Net::theReactor().stop(); + } + return arg; +} + int main(int argc, char **argv) { - F f; - MSN::Net::theReactor().connectSSL("google.com", 443, f); + F f1, f2; + f1.deferred.addCallback(finished); + f2.deferred.addCallback(finished); + MSN::Net::theReactor().connectSSL("google.com", 443, f1); + MSN::Net::theReactor().connectSSL("google.com", 443, f2); MSN::Net::theReactor().run(); } |
From: <bd...@bd...> - 2004-12-19 21:23:36
|
Author: bdash Date: 2004-12-20 10:23:27 +1300 (Mon, 20 Dec 2004) New Revision: 328 Added: branches/libmsn-experimental/msn/examples/simple_https.cpp Modified: branches/libmsn-experimental/msn/Jamfile Log: C++ version of simple_https. Modified: branches/libmsn-experimental/msn/Jamfile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/Jamfile 2004-12-19 12:59:05 UTC (rev= 327) +++ branches/libmsn-experimental/msn/Jamfile 2004-12-19 21:23:27 UTC (rev= 328) @@ -29,4 +29,15 @@ <sysinclude>$(BOOST_ROOT) <find-library>ssl <find-library>crypto + ; + +exe simple_https + : + examples/simple_https.cpp + <lib>msn + : + <sysinclude>/../.. + <sysinclude>$(BOOST_ROOT) + <find-library>ssl + <find-library>crypto ; \ No newline at end of file Copied: branches/libmsn-experimental/msn/examples/simple_https.cpp (from = rev 323, branches/libmsn-experimental/msn/examples/simple_http2.cpp) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/examples/simple_http2.cpp 2004-12-19= 08:17:30 UTC (rev 323) +++ branches/libmsn-experimental/msn/examples/simple_https.cpp 2004-12-19= 21:23:27 UTC (rev 328) @@ -0,0 +1,71 @@ +#include <msn/net/protocol.hpp> +#include <msn/net/transport.hpp> +#include <msn/net/connector.hpp> +#include <msn/net/reactor.hpp> + +class MyLineReceiver : public MSN::Net::LineReceiverProtocol +{ + public: + MyLineReceiver() : MSN::Net::LineReceiverProtocol() {}; + virtual ~MyLineReceiver() {}; + =20 + void connectionMade() + { + fprintf(stderr, "connectionMade\n"); + this->sendLine("GET /adsense/ HTTP/1.0"); + this->sendLine("Host: google.com\n"); + this->sendLine(""); + } + =20 + void lineReceived(const std::string & line) + { + fprintf(stderr, "lineReceived\n"); + this->setRawMode(); + } + =20 + void rawDataReceived(const std::string & data) + { + fprintf(stderr, "rawDataReceived\n"); + } + =20 + void connectionLost(const MSN::Net::DisconnectReason & reason) + { + fprintf(stderr, "connectionLost\n"); + } +}; + +class F : public MSN::Net::ClientFactory +{ + public: + F() : MSN::Net::ClientFactory() {}; + virtual ~F() {}; + =20 + virtual MSN::Net::Protocol * buildProtocol() + { + return new MyLineReceiver(); + } + =20 + void clientConnectionLost(MSN::Net::TCPConnector & connector, co= nst MSN::Net::DisconnectReason & reason) + { + fprintf(stderr, "clientConnectionLost\n"); + MSN::Net::theReactor().stop(); + } + + void clientConnectionFailed(MSN::Net::TCPConnector & connector, = const MSN::Net::SocketError & reason) + { + fprintf(stderr, "clientConnectionFailed\n"); + MSN::Net::theReactor().stop(); + } + =20 + void startedConnecting() + { + fprintf(stderr, "startedConnecting\n"); + } +}; + +int main(int argc, char **argv) +{ + F f; + MSN::Net::theReactor().connectSSL("google.com", 443, f); + MSN::Net::theReactor().run(); +} |
From: <bd...@bd...> - 2004-12-19 12:59:13
|
Author: bdash Date: 2004-12-20 01:59:05 +1300 (Mon, 20 Dec 2004) New Revision: 327 Modified: branches/libmsn-experimental/msn/net/transport.cpp branches/libmsn-experimental/msn/net/transport.hpp Log: Remove unneeded methods. Modified: branches/libmsn-experimental/msn/net/transport.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/transport.cpp 2004-12-19 12:47:4= 6 UTC (rev 326) +++ branches/libmsn-experimental/msn/net/transport.cpp 2004-12-19 12:59:0= 5 UTC (rev 327) @@ -172,17 +172,5 @@ { printf("SSLClient::~SSLClient\n"); } - =20 - void SSLClient::doRead() - { - printf("SSLClient::doRead\n"); - TCPClient::doRead(); - } - =20 - int SSLClient::doWrite() - { - printf("SSLClient::doWrite\n"); - return TCPClient::doWrite(); - } }; }; Modified: branches/libmsn-experimental/msn/net/transport.hpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/transport.hpp 2004-12-19 12:47:4= 6 UTC (rev 326) +++ branches/libmsn-experimental/msn/net/transport.hpp 2004-12-19 12:59:0= 5 UTC (rev 327) @@ -69,9 +69,6 @@ SSLClient(const std::string & host, unsigned short port, Protocol & protocol, TCPConnector & connector); virtual ~SSLClient(); - - virtual void doRead(); - virtual int doWrite(); }; }; }; |
From: <bd...@bd...> - 2004-12-19 12:47:53
|
Author: bdash Date: 2004-12-20 01:47:46 +1300 (Mon, 20 Dec 2004) New Revision: 326 Modified: branches/libmsn-experimental/msn/net/socket.cpp Log: Initialise members. Modified: branches/libmsn-experimental/msn/net/socket.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/socket.cpp 2004-12-19 12:10:47 U= TC (rev 325) +++ branches/libmsn-experimental/msn/net/socket.cpp 2004-12-19 12:47:46 U= TC (rev 326) @@ -202,7 +202,10 @@ } =20 =20 - SSLSocket::SSLSocket() : Socket() + SSLSocket::SSLSocket() : + Socket(), + _waitingOnRead(false), _waitingOnWrite(false), + _writeBlockedOnRead(false), _readBlockedOnWrite(false) { printf("SSLSocket::SSLSocket\n"); SSL_library_init(); |
From: <bd...@bd...> - 2004-12-19 12:10:53
|
Author: bdash Date: 2004-12-20 01:10:47 +1300 (Mon, 20 Dec 2004) New Revision: 325 Modified: branches/libmsn-experimental/Makefile Log: Add make clean option. Modified: branches/libmsn-experimental/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/Makefile 2004-12-19 12:05:12 UTC (rev 32= 4) +++ branches/libmsn-experimental/Makefile 2004-12-19 12:10:47 UTC (rev 32= 5) @@ -29,3 +29,6 @@ =20 test: @bjam $(BJAM_FLAGS) test + +clean: + @bjam $(BJAM_FLAGS) clean \ No newline at end of file |
From: <bd...@bd...> - 2004-12-19 12:06:02
|
Author: bdash Date: 2004-12-20 01:05:12 +1300 (Mon, 20 Dec 2004) New Revision: 324 Added: branches/libmsn-experimental/python/examples/simple_https.py Modified: branches/libmsn-experimental/msn/Jamfile branches/libmsn-experimental/msn/net/connector.cpp branches/libmsn-experimental/msn/net/connector.hpp branches/libmsn-experimental/msn/net/reactor.cpp branches/libmsn-experimental/msn/net/reactor.hpp branches/libmsn-experimental/msn/net/socket.cpp branches/libmsn-experimental/msn/net/socket.hpp branches/libmsn-experimental/msn/net/transport.cpp branches/libmsn-experimental/msn/net/transport.hpp branches/libmsn-experimental/python/Jamfile branches/libmsn-experimental/python/reactor.cpp Log: Initial SSL client support. Needs a lot more testing + cleanup. Modified: branches/libmsn-experimental/msn/Jamfile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/Jamfile 2004-12-19 08:17:30 UTC (rev= 323) +++ branches/libmsn-experimental/msn/Jamfile 2004-12-19 12:05:12 UTC (rev= 324) @@ -14,6 +14,8 @@ : <sysinclude>/../.. <sysinclude>$(BOOST_ROOT) + <find-library>ssl + <find-library>crypto : ; =20 @@ -25,4 +27,6 @@ : <sysinclude>/../.. <sysinclude>$(BOOST_ROOT) + <find-library>ssl + <find-library>crypto ; \ No newline at end of file Modified: branches/libmsn-experimental/msn/net/connector.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/connector.cpp 2004-12-19 08:17:3= 0 UTC (rev 323) +++ branches/libmsn-experimental/msn/net/connector.cpp 2004-12-19 12:05:1= 2 UTC (rev 324) @@ -10,11 +10,16 @@ this->_factory.setConnector(this); } =20 + TCPClient *TCPConnector::_makeTransport() + { + return new TCPClient(this->_host, this->_port, *this->_factory.b= uildProtocol(), *this); + } + =20 void TCPConnector::connect() { printf("TCPConnector::connect()\n"); this->_state =3D TCPConnector::STATE_CONNECTING; - this->_transport =3D boost::shared_ptr<TCPClient>(new TCPClient(= this->_host, this->_port, *this->_factory.buildProtocol(), *this)); + this->_transport =3D boost::shared_ptr<TCPClient>(this->_makeTra= nsport()); this->_transport->connect(); this->_factory.startedConnecting(); } @@ -52,5 +57,10 @@ this->_state =3D TCPConnector::STATE_DISCONNECTED; this->_factory.clientConnectionLost(*this, reason); } + + TCPClient *SSLConnector::_makeTransport() + { + return new SSLClient(this->_host, this->_port, *this->_factory.b= uildProtocol(), *this); + } } }; Modified: branches/libmsn-experimental/msn/net/connector.hpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/connector.hpp 2004-12-19 08:17:3= 0 UTC (rev 323) +++ branches/libmsn-experimental/msn/net/connector.hpp 2004-12-19 12:05:1= 2 UTC (rev 324) @@ -65,7 +65,7 @@ enum { STATE_DISCONNECTED, STATE_CONNECTING, STATE_CONNECTED= } _state; boost::shared_ptr<TCPClient> _transport; =20 - TCPClient _makeTransport(); + virtual TCPClient *_makeTransport(); =20 private: TCPConnector(const TCPConnector & connector); @@ -73,6 +73,19 @@ =20 }; =20 + class SSLConnector : public TCPConnector=20 + { + public: + SSLConnector(const std::string & host, unsigned short port, = ClientFactory & factory) : TCPConnector(host, port, factory) {}; + =20 + protected: + virtual TCPClient *_makeTransport(); + + private: + SSLConnector(const SSLConnector & connector); + SSLConnector operator=3D(const SSLConnector&); + }; + =20 }; }; =20 Modified: branches/libmsn-experimental/msn/net/reactor.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/reactor.cpp 2004-12-19 08:17:30 = UTC (rev 323) +++ branches/libmsn-experimental/msn/net/reactor.cpp 2004-12-19 12:05:12 = UTC (rev 324) @@ -36,6 +36,14 @@ t->connect(); return factory.connector(); } + + boost::shared_ptr<TCPConnector> BaseReactor::connectSSL(const std::s= tring & host, unsigned short port, + ClientFactor= y & factory) + { + SSLConnector *t =3D new SSLConnector(host, port, factory); + t->connect(); + return factory.connector(); + } =20 void BaseReactor::addReader(FileDescriptor & reader) { Modified: branches/libmsn-experimental/msn/net/reactor.hpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/reactor.hpp 2004-12-19 08:17:30 = UTC (rev 323) +++ branches/libmsn-experimental/msn/net/reactor.hpp 2004-12-19 12:05:12 = UTC (rev 324) @@ -14,6 +14,7 @@ class BaseReactor; class FileDescriptor; class TCPConnector; + class SSLConnector; class ClientFactory; =20 BaseReactor & theReactor(); @@ -26,6 +27,8 @@ virtual ~BaseReactor() {}; boost::shared_ptr<TCPConnector> connectTCP(const std::string= & host, unsigned short port, ClientFactory & f= actory); + boost::shared_ptr<TCPConnector> connectSSL(const std::string= & host, unsigned short port, + ClientFactory & f= actory); =20 void addReader(FileDescriptor & reader); void removeReader(FileDescriptor & reader); Modified: branches/libmsn-experimental/msn/net/socket.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/socket.cpp 2004-12-19 08:17:30 U= TC (rev 323) +++ branches/libmsn-experimental/msn/net/socket.cpp 2004-12-19 12:05:12 U= TC (rev 324) @@ -7,6 +7,9 @@ #include <netdb.h> #include <fcntl.h> =20 +#include <openssl/ssl.h> +#include <openssl/err.h> + namespace MSN { namespace Net @@ -140,7 +143,7 @@ } =20 =20 - std::string Socket::read(unsigned int readAmount) const + std::string Socket::read(unsigned int readAmount) { printf("Socket::read(readAmount=3D%d)\n", readAmount); char buffer[Socket::MAX_RECEIVE_SIZE]; @@ -154,7 +157,7 @@ return std::string(buffer, len); } =20 - unsigned int Socket::write(const std::string & data) const + unsigned int Socket::write(const std::string & data) { printf("Socket::write(data=3D%s)\n", data.c_str()); if (! this->isValid()) @@ -197,5 +200,174 @@ addr =3D htonl(addr); return inet_ntoa(*(struct in_addr *) &addr); } + =20 + =20 + SSLSocket::SSLSocket() : Socket() + { + printf("SSLSocket::SSLSocket\n"); + SSL_library_init(); + SSL_load_error_strings(); + + SSL_METHOD *meth =3D SSLv2_method(); + if (! (this->_ctx =3D SSL_CTX_new(meth))) + goto err; + =20 + if (! (this->_ssl =3D SSL_new(this->_ctx))) + goto err; + =20 + if (! (this->_bio =3D BIO_new_socket(this->_socket, BIO_NOCLOSE)= )) + goto err; + =20 + SSL_set_bio(this->_ssl, this->_bio, this->_bio); =20 + =20 + return; + =20 + err: + =20 + ERR_print_errors_fp(stderr); + throw std::runtime_error("SSL problem!"); + } + =20 + SSLSocket::~SSLSocket() + { + printf("SSLSocket::~SSLSocket\n"); + } + + std::string SSLSocket::read(unsigned int readAmount) + { + printf("SSLSocket::read(readAmount=3D%d)\n", readAmount); + char buffer[Socket::MAX_RECEIVE_SIZE]; + if (! this->isValid()) + throw SocketError("Cannot read from an invalid socket!"); + + this->_waitingOnRead =3D false; + this->_readBlockedOnWrite =3D false; + =20 + int result =3D SSL_read(this->_ssl, &buffer[0], (readAmount > So= cket::MAX_RECEIVE_SIZE ? Socket::MAX_RECEIVE_SIZE : readAmount)); + int error =3D SSL_get_error(this->_ssl, result); + printf("SSL_read returned: %d\n", error); =20 + switch (error) + { + case SSL_ERROR_NONE: + return std::string(buffer, result); + + case SSL_ERROR_ZERO_RETURN: + throw SystemSocketError(ENOTCONN); + =20 + case SSL_ERROR_WANT_READ: + this->_waitingOnRead =3D true; + break; + =20 + case SSL_ERROR_WANT_WRITE: + this->_readBlockedOnWrite =3D true; + break; + =20 + default: + ERR_print_errors_fp(stderr); =20 + throw SocketError("Unknown SSL error"); + } + throw SystemSocketError(EWOULDBLOCK); + } + =20 + unsigned int SSLSocket::write(const std::string & data) + { + printf("SSLSocket::write(data=3D%s)\n", data.c_str()); + if (! this->isValid()) + throw SocketError("Cannot write to an invalid socket!"); + + this->_waitingOnWrite =3D false; + this->_writeBlockedOnRead =3D false; + =20 + int result =3D SSL_write(this->_ssl, data.c_str(), data.size()); + int error =3D SSL_get_error(this->_ssl, result); + printf("SSL_write returned: %d\n", error); =20 + switch (error) + { + case SSL_ERROR_NONE: + case SSL_ERROR_ZERO_RETURN: =20 + return result; + =20 + case SSL_ERROR_WANT_READ: + this->_writeBlockedOnRead =3D true; + break; + =20 + case SSL_ERROR_WANT_WRITE: + this->_waitingOnWrite =3D true; + break; + =20 + default: + ERR_print_errors_fp(stderr); =20 + throw SocketError("Unknown SSL error"); + } + throw SystemSocketError(EWOULDBLOCK); + } + =20 + void SSLSocket::connect(const std::string & hostName, unsigned short= port) + { + printf("SSLSocket::connect(hostname=3D%s, port=3D%d)\n", hostNam= e.c_str(), port); + + int result; + if (! (this->_waitingOnRead || this->_waitingOnWrite)) + { + try + { + Socket::connect(hostName, port); + } + catch (const SystemSocketError & error) + { + switch (error.errorCode()) + { + case EISCONN: + break; + default: + throw; + } + } + } + =20 + this->_waitingOnRead =3D this->_waitingOnWrite =3D false; + if ((result =3D SSL_connect(this->_ssl)) <=3D 0) + { + int error =3D SSL_get_error(this->_ssl, result); + printf("SSL_connect failed: %d\n", error); + switch (error) + { + case SSL_ERROR_NONE: + break; + case SSL_ERROR_WANT_READ: + this->_waitingOnRead =3D true; + break; + case SSL_ERROR_WANT_WRITE: + this->_waitingOnWrite =3D true; + break; + case SSL_ERROR_SYSCALL: + throw SystemSocketError(); + default: + ERR_print_errors_fp(stderr); =20 + throw SocketError("Unknown SSL Error"); + } + if (error) + throw SystemSocketError(EINPROGRESS); + } + else + printf("SSL_connect succeeded!\n"); + } + =20 + void SSLSocket::disconnect() + { + printf("SSLSocket::disconnect()\n"); + if (this->_ssl) + SSL_free(this->_ssl); + =20 + if (this->_ctx) + SSL_CTX_free(this->_ctx); + =20 + =20 + this->_ssl =3D NULL; + this->_bio =3D NULL; + this->_ctx =3D NULL; + =20 + Socket::disconnect(); + }=20 } }; Modified: branches/libmsn-experimental/msn/net/socket.hpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/socket.hpp 2004-12-19 08:17:30 U= TC (rev 323) +++ branches/libmsn-experimental/msn/net/socket.hpp 2004-12-19 12:05:12 U= TC (rev 324) @@ -7,6 +7,10 @@ =20 #include <boost/shared_ptr.hpp> =20 +typedef struct ssl_ctx_st SSL_CTX; +typedef struct ssl_st SSL; +typedef struct bio_st BIO; + namespace MSN { namespace Net @@ -34,30 +38,57 @@ public: Socket(); Socket(const Socket & socket); - ~Socket(); + virtual ~Socket(); =20 - void connect(const std::string & hostName, unsigned short po= rt); - void disconnect(); + virtual void connect(const std::string & hostName, unsigned = short port); + virtual void disconnect(); void bind(const std::string & hostName, unsigned short port)= const; void listen(unsigned int backlog) const; std::pair<boost::shared_ptr<Socket>, std::pair<std::string, = unsigned short> > accept() const; =20 - std::string read(unsigned int readAmount) const; - unsigned int write(const std::string & data) const; + virtual std::string read(unsigned int readAmount); + virtual unsigned int write(const std::string & data); =20 - bool isValid() const; + virtual bool isValid() const; int handle() const; =20 Socket & operator=3D(const Socket &); + protected: + int _socket; + static const unsigned int MAX_RECEIVE_SIZE =3D 4096; + private: Socket(int fileHandle); - =20 - int _socket; - static const unsigned int MAX_RECEIVE_SIZE =3D 4096; =20 unsigned long _nameToAddress(const std::string &hostName) co= nst; std::string _addressToName(unsigned long addr) const; }; + =20 + class SSLSocket : public Socket + { + public: + SSLSocket(); + virtual ~SSLSocket(); + + virtual std::string read(unsigned int readAmount); + virtual unsigned int write(const std::string & data); + virtual void connect(const std::string & hostName, unsigned = short port); + virtual void disconnect(); + protected: + SSL_CTX *_ctx; + SSL *_ssl; + BIO *_bio; + =20 + bool _waitingOnRead; + bool _waitingOnWrite; + =20 + bool _writeBlockedOnRead; + bool _readBlockedOnWrite; + =20 + private: + SSLSocket(const SSLSocket & socket); + SSLSocket & operator=3D(const SSLSocket &); + }; }; }; =20 Modified: branches/libmsn-experimental/msn/net/transport.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/transport.cpp 2004-12-19 08:17:3= 0 UTC (rev 323) +++ branches/libmsn-experimental/msn/net/transport.cpp 2004-12-19 12:05:1= 2 UTC (rev 324) @@ -65,6 +65,14 @@ { printf("TCPClient::TCPClient(host=3D%s, port=3D%d, protocol, con= nector)\n", host.c_str(), port); } + + TCPClient::TCPClient(boost::shared_ptr<Socket> socket, const std::st= ring & host, unsigned short port, + Protocol & protocol, TCPConnector & connector) = : + TCPTransport(socket, protocol, connector), + _shouldDoConnect(true), _host(host), _port(port) + { + printf("TCPClient::TCPClient(host=3D%s, port=3D%d, protocol, con= nector)\n", host.c_str(), port); + } =20 TCPClient::~TCPClient() { @@ -109,6 +117,8 @@ case EALREADY: { printf(" connection in progress.\n"); + this->stopReading(); + this->stopWriting(); this->startReading(); this->startWriting(); return; @@ -151,5 +161,28 @@ this->stopWriting(); } =20 + SSLClient::SSLClient(const std::string & host, unsigned short port, + Protocol & protocol, TCPConnector & connector) = : + TCPClient(boost::shared_ptr<Socket>(new SSLSocket()), host, port= , protocol, connector) + { + printf("SSLClient::SSLClient(host=3D%s, port=3D%d, protocol, con= nector)\n", host.c_str(), port); + } + =20 + SSLClient::~SSLClient() + { + printf("SSLClient::~SSLClient\n"); + } + =20 + void SSLClient::doRead() + { + printf("SSLClient::doRead\n"); + TCPClient::doRead(); + } + =20 + int SSLClient::doWrite() + { + printf("SSLClient::doWrite\n"); + return TCPClient::doWrite(); + } }; }; Modified: branches/libmsn-experimental/msn/net/transport.hpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/transport.hpp 2004-12-19 08:17:3= 0 UTC (rev 323) +++ branches/libmsn-experimental/msn/net/transport.hpp 2004-12-19 12:05:1= 2 UTC (rev 324) @@ -38,6 +38,8 @@ public: TCPClient(const std::string & host, unsigned short port, Protocol & protocol, TCPConnector & connector); + TCPClient(boost::shared_ptr<Socket> socket, const std::strin= g & host, unsigned short port, + Protocol & protocol, TCPConnector & connector); virtual ~TCPClient(); =20 virtual void doRead(); @@ -60,6 +62,17 @@ TCPClient(const TCPClient & client); TCPClient operator=3D(const TCPClient &); }; + =20 + class SSLClient : public TCPClient + { + public: + SSLClient(const std::string & host, unsigned short port, + Protocol & protocol, TCPConnector & connector); + virtual ~SSLClient(); + + virtual void doRead(); + virtual int doWrite(); + }; }; }; =20 Modified: branches/libmsn-experimental/python/Jamfile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/python/Jamfile 2004-12-19 08:17:30 UTC (= rev 323) +++ branches/libmsn-experimental/python/Jamfile 2004-12-19 12:05:12 UTC (= rev 324) @@ -21,6 +21,8 @@ <template>@boost/libs/python/build/extension : <sysinclude>/../.. + <find-library>ssl + <find-library>crypto ; =20 # Declare a test for the extension module Copied: branches/libmsn-experimental/python/examples/simple_https.py (fro= m rev 321, branches/libmsn-experimental/python/examples/simple_http2.py) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/python/examples/simple_http2.py 2004-12-= 19 07:27:58 UTC (rev 321) +++ branches/libmsn-experimental/python/examples/simple_https.py 2004-12-= 19 12:05:12 UTC (rev 324) @@ -0,0 +1,42 @@ +import MSN, sys + +class MyLineReceiver(MSN.LineReceiverProtocol): + def connectionMade(self): + print >> sys.stderr, self, 'connectionMade' + self.sendLine('GET /adsense/ HTTP/1.0') + self.sendLine('Host: www.google.com') + self.sendLine('') + self._messageData =3D '' + =20 + def lineReceived(self, line): + print >> sys.stderr, self, 'lineReceived', repr(line) + self.setRawMode() + =20 + def rawDataReceived(self, data): + print >> sys.stderr, self, 'rawDataReceived' + self._messageData +=3D data + =20 + def connectionLost(self, err): + print >> sys.stderr, self, 'connectionLost', err + self.factory.buildMessage(self._messageData) + +class F(MSN.ClientFactory): + def __init__(self): + MSN.ClientFactory.__init__(self) + self.protocol =3D MyLineReceiver() + =20 + def clientConnectionLost(self, connector, err): + print >> sys.stderr, self, 'clientConnectionLost', err + MSN.theReactor().stop() + + def clientConnectionFailed(self, connector, err): + print >> sys.stderr, self, 'clientConnectionFailed', err + MSN.theReactor().stop() + =20 + def buildMessage(self, data): + m =3D MSN._MIMEMessage(data) + +r =3D MSN.theReactor() +f =3D F() +r.connectSSL('google.com', 443, f) +r.run() Modified: branches/libmsn-experimental/python/reactor.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/python/reactor.cpp 2004-12-19 08:17:30 U= TC (rev 323) +++ branches/libmsn-experimental/python/reactor.cpp 2004-12-19 12:05:12 U= TC (rev 324) @@ -28,6 +28,7 @@ { class_< _BaseReactorWrap, boost::noncopyable > ("BaseReactor", init<= >()) .def("connectTCP", &MSN::Net::BaseReactor::connectTCP) // , retu= rn_internal_reference<>()) + .def("connectSSL", &MSN::Net::BaseReactor::connectSSL) // , retu= rn_internal_reference<>()) .def("run", &MSN::Net::BaseReactor::run) .def("stop", &MSN::Net::BaseReactor::stop) ; |
From: <bd...@bd...> - 2004-12-19 08:17:39
|
Author: bdash Date: 2004-12-19 21:17:30 +1300 (Sun, 19 Dec 2004) New Revision: 323 Modified: branches/libmsn-experimental/msn/examples/simple_http2.cpp Log: Newline at EOF... Modified: branches/libmsn-experimental/msn/examples/simple_http2.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/examples/simple_http2.cpp 2004-12-19= 07:32:13 UTC (rev 322) +++ branches/libmsn-experimental/msn/examples/simple_http2.cpp 2004-12-19= 08:17:30 UTC (rev 323) @@ -68,4 +68,4 @@ F f; MSN::Net::theReactor().connectTCP("bdash.net.nz", 80, f); MSN::Net::theReactor().run(); -} \ No newline at end of file +} |
From: <bd...@bd...> - 2004-12-19 07:32:21
|
Author: bdash Date: 2004-12-19 20:32:13 +1300 (Sun, 19 Dec 2004) New Revision: 322 Modified: branches/libmsn-experimental/msn/net/connector.hpp Log: Make ClientFactory::setConnector and ClientFactory::connector private, bu= t accessible to the two classes that need them. Modified: branches/libmsn-experimental/msn/net/connector.hpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/connector.hpp 2004-12-19 07:27:5= 8 UTC (rev 321) +++ branches/libmsn-experimental/msn/net/connector.hpp 2004-12-19 07:32:1= 3 UTC (rev 322) @@ -25,15 +25,25 @@ virtual void clientConnectionFailed(TCPConnector & connector= , const SocketError & reason) =3D 0; virtual void clientConnectionLost(TCPConnector & connector, = const DisconnectReason & reason) =3D 0; virtual void startedConnecting() =3D 0; - =20 - void setConnector(TCPConnector *connector) { this->_connecto= r =3D boost::shared_ptr<TCPConnector>(connector); }; - boost::shared_ptr<TCPConnector> connector() { return this->_= connector; } - =20 + =20 private: boost::shared_ptr<TCPConnector> _connector; =20 ClientFactory(const ClientFactory & factory); - ClientFactory operator=3D(const ClientFactory&); =20 + ClientFactory operator=3D(const ClientFactory&); + =20 + friend class TCPConnector; + friend class BaseReactor; + void setConnector(TCPConnector *connector) + { + =20 + this->_connector =3D boost::shared_ptr<TCPConnector>(con= nector); + }; + =20 + boost::shared_ptr<TCPConnector> connector() + { + return this->_connector; + } }; =20 =20 |
From: <bd...@bd...> - 2004-12-19 07:28:11
|
Author: bdash Date: 2004-12-19 20:27:58 +1300 (Sun, 19 Dec 2004) New Revision: 321 Modified: branches/libmsn-experimental/msn/examples/simple_http2.cpp branches/libmsn-experimental/msn/net/connector.cpp branches/libmsn-experimental/msn/net/connector.hpp branches/libmsn-experimental/msn/net/reactor.cpp branches/libmsn-experimental/python/examples/simple_http2.py Log: Have the Factory manage the TCPConnector's lifetime. This means that use= r code doesn't have to keep the TCPConnector alive for us. Modified: branches/libmsn-experimental/msn/examples/simple_http2.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/examples/simple_http2.cpp 2004-12-19= 07:03:42 UTC (rev 320) +++ branches/libmsn-experimental/msn/examples/simple_http2.cpp 2004-12-19= 07:27:58 UTC (rev 321) @@ -66,6 +66,6 @@ int main(int argc, char **argv) { F f; - boost::shared_ptr<MSN::Net::TCPConnector> t =3D MSN::Net::theReactor= ().connectTCP("bdash.net.nz", 80, f); + MSN::Net::theReactor().connectTCP("bdash.net.nz", 80, f); MSN::Net::theReactor().run(); } \ No newline at end of file Modified: branches/libmsn-experimental/msn/net/connector.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/connector.cpp 2004-12-19 07:03:4= 2 UTC (rev 320) +++ branches/libmsn-experimental/msn/net/connector.cpp 2004-12-19 07:27:5= 8 UTC (rev 321) @@ -7,7 +7,7 @@ { TCPConnector::TCPConnector(const std::string & host, unsigned short = port, ClientFactory & factory) : _host(host), _port(port), _factory(facto= ry) { - =20 + this->_factory.setConnector(this); } =20 void TCPConnector::connect() Modified: branches/libmsn-experimental/msn/net/connector.hpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/connector.hpp 2004-12-19 07:03:4= 2 UTC (rev 320) +++ branches/libmsn-experimental/msn/net/connector.hpp 2004-12-19 07:27:5= 8 UTC (rev 321) @@ -18,14 +18,20 @@ { public: ClientFactory() {}; + virtual ~ClientFactory() {}; =20 virtual MSN::Net::Protocol * buildProtocol() =3D 0; =20 virtual void clientConnectionFailed(TCPConnector & connector= , const SocketError & reason) =3D 0; virtual void clientConnectionLost(TCPConnector & connector, = const DisconnectReason & reason) =3D 0; virtual void startedConnecting() =3D 0; + =20 + void setConnector(TCPConnector *connector) { this->_connecto= r =3D boost::shared_ptr<TCPConnector>(connector); }; + boost::shared_ptr<TCPConnector> connector() { return this->_= connector; } =20 private: + boost::shared_ptr<TCPConnector> _connector; + =20 ClientFactory(const ClientFactory & factory); ClientFactory operator=3D(const ClientFactory&); =20 }; Modified: branches/libmsn-experimental/msn/net/reactor.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/net/reactor.cpp 2004-12-19 07:03:42 = UTC (rev 320) +++ branches/libmsn-experimental/msn/net/reactor.cpp 2004-12-19 07:27:58 = UTC (rev 321) @@ -32,9 +32,9 @@ boost::shared_ptr<TCPConnector> BaseReactor::connectTCP(const std::s= tring & host, unsigned short port, ClientFactor= y & factory) { - boost::shared_ptr<TCPConnector> t(new TCPConnector(host, port, f= actory)); + TCPConnector *t =3D new TCPConnector(host, port, factory); t->connect(); - return t; + return factory.connector(); } =20 void BaseReactor::addReader(FileDescriptor & reader) Modified: branches/libmsn-experimental/python/examples/simple_http2.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/python/examples/simple_http2.py 2004-12-= 19 07:03:42 UTC (rev 320) +++ branches/libmsn-experimental/python/examples/simple_http2.py 2004-12-= 19 07:27:58 UTC (rev 321) @@ -38,5 +38,5 @@ =20 r =3D MSN.theReactor() f =3D F() -t =3D r.connectTCP('bdash.net.nz', 80, f) +r.connectTCP('bdash.net.nz', 80, f) r.run() |
From: <bd...@bd...> - 2004-12-19 07:03:53
|
Author: bdash Date: 2004-12-19 20:03:42 +1300 (Sun, 19 Dec 2004) New Revision: 320 Added: branches/libmsn-experimental/msn/examples/ branches/libmsn-experimental/msn/examples/simple_http2.cpp Modified: branches/libmsn-experimental/msn/Jamfile Log: Add a C++ example that is more or less equivalent to the Python example o= f the same name. Modified: branches/libmsn-experimental/msn/Jamfile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/Jamfile 2004-12-18 13:40:14 UTC (rev= 319) +++ branches/libmsn-experimental/msn/Jamfile 2004-12-19 07:03:42 UTC (rev= 320) @@ -13,6 +13,16 @@ net/connector.cpp : <sysinclude>/../.. - <sysinclude>$(BOOST_ROOT) =20 + <sysinclude>$(BOOST_ROOT) : + ; + + +exe simple_http2 + : + examples/simple_http2.cpp + <lib>msn + : + <sysinclude>/../.. + <sysinclude>$(BOOST_ROOT) ; \ No newline at end of file Added: branches/libmsn-experimental/msn/examples/simple_http2.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/msn/examples/simple_http2.cpp 2004-12-18= 13:40:14 UTC (rev 319) +++ branches/libmsn-experimental/msn/examples/simple_http2.cpp 2004-12-19= 07:03:42 UTC (rev 320) @@ -0,0 +1,71 @@ +#include <msn/net/protocol.hpp> +#include <msn/net/transport.hpp> +#include <msn/net/connector.hpp> +#include <msn/net/reactor.hpp> + +class MyLineReceiver : public MSN::Net::LineReceiverProtocol +{ + public: + MyLineReceiver() : MSN::Net::LineReceiverProtocol() {}; + virtual ~MyLineReceiver() {}; + =20 + void connectionMade() + { + fprintf(stderr, "connectionMade\n"); + this->sendLine("GET / HTTP/1.0"); + this->sendLine("Host: bdash.net.nz\n"); + this->sendLine(""); + } + =20 + void lineReceived(const std::string & line) + { + fprintf(stderr, "lineReceived\n"); + this->setRawMode(); + } + =20 + void rawDataReceived(const std::string & data) + { + fprintf(stderr, "rawDataReceived\n"); + } + =20 + void connectionLost(const MSN::Net::DisconnectReason & reason) + { + fprintf(stderr, "connectionLost\n"); + } +}; + +class F : public MSN::Net::ClientFactory +{ + public: + F() : MSN::Net::ClientFactory() {}; + virtual ~F() {}; + =20 + virtual MSN::Net::Protocol * buildProtocol() + { + return new MyLineReceiver(); + } + =20 + void clientConnectionLost(MSN::Net::TCPConnector & connector, co= nst MSN::Net::DisconnectReason & reason) + { + fprintf(stderr, "clientConnectionLost\n"); + MSN::Net::theReactor().stop(); + } + + void clientConnectionFailed(MSN::Net::TCPConnector & connector, = const MSN::Net::SocketError & reason) + { + fprintf(stderr, "clientConnectionFailed\n"); + MSN::Net::theReactor().stop(); + } + =20 + void startedConnecting() + { + fprintf(stderr, "startedConnecting\n"); + } +}; + +int main(int argc, char **argv) +{ + F f; + boost::shared_ptr<MSN::Net::TCPConnector> t =3D MSN::Net::theReactor= ().connectTCP("bdash.net.nz", 80, f); + MSN::Net::theReactor().run(); +} \ No newline at end of file Property changes on: branches/libmsn-experimental/msn/examples/simple_htt= p2.cpp ___________________________________________________________________ Name: svn:eol-style + native |
From: <bd...@bd...> - 2004-12-18 13:40:20
|
Author: bdash Date: 2004-12-19 02:40:14 +1300 (Sun, 19 Dec 2004) New Revision: 319 Modified: branches/libmsn-experimental/Makefile Log: A bit of 'documentation'. Modified: branches/libmsn-experimental/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/Makefile 2004-12-18 13:32:42 UTC (rev 31= 8) +++ branches/libmsn-experimental/Makefile 2004-12-18 13:40:14 UTC (rev 31= 9) @@ -1,11 +1,19 @@ +# The following flags can be specified either as environment variables o= r +# on the `make' command-line: +# TOOLS *should* be set to a valid Boost.Build toolkit, such as gcc or= darwin. +# BOOST_ROOT *should* be the path to the root of a Boost installation. +# PYTHON_ROOT *may* be set to Python's prefix -- python -c "import sys= ; print sys.prefix" + +USAGE=3D@echo "Usage: make TOOLS=3D<boost toolset> BOOST_ROOT=3D<path to= boost> [PYTHON_ROOT=3D<path to python>]" + ifndef TOOLS error1: - @echo "Usage: make TOOLS=3D<boost toolset> BOOST_ROOT=3D<path to boost>= [PYTHON_ROOT=3D<path to python>]" + $(USAGE) endif =20 ifndef BOOST_ROOT error2: - @echo "Usage: make TOOLS=3D<boost toolset> BOOST_ROOT=3D<path to boost>= [PYTHON_ROOT=3D<path to python>]" + $(USAGE) endif =20 PYTHON_VERSION?=3D2.3 |
From: <bd...@bd...> - 2004-12-18 13:32:48
|
Author: bdash Date: 2004-12-19 02:32:42 +1300 (Sun, 19 Dec 2004) New Revision: 318 Modified: branches/libmsn-experimental/Makefile Log: Allow passing of PYTHON_ROOT on make command-line. Modified: branches/libmsn-experimental/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/Makefile 2004-12-18 13:28:22 UTC (rev 31= 7) +++ branches/libmsn-experimental/Makefile 2004-12-18 13:32:42 UTC (rev 31= 8) @@ -1,18 +1,20 @@ ifndef TOOLS error1: - @echo "Usage: make TOOLS=3D<boost toolset> BOOST_ROOT=3D<path to boost>= " + @echo "Usage: make TOOLS=3D<boost toolset> BOOST_ROOT=3D<path to boost>= [PYTHON_ROOT=3D<path to python>]" endif =20 ifndef BOOST_ROOT error2: - @echo "Usage: make TOOLS=3D<boost toolset> BOOST_ROOT=3D<path to boost>= " + @echo "Usage: make TOOLS=3D<boost toolset> BOOST_ROOT=3D<path to boost>= [PYTHON_ROOT=3D<path to python>]" endif =20 - PYTHON_VERSION?=3D2.3 BOOST_BUILD=3D$(BOOST_ROOT)/tools/build/v1 =20 BJAM_FLAGS=3D-sPYTHON_VERSION=3D$(PYTHON_VERSION) -sBOOST_BUILD=3D$(BOOS= T_BUILD) -sBOOST_ROOT=3D$(BOOST_ROOT) -sTOOLS=3D$(TOOLS) +ifdef PYTHON_ROOT +BJAM_FLAGS+=3D -sPYTHON_ROOT=3D$(PYTHON_ROOT) +endif =20 all: @bjam $(BJAM_FLAGS) |
From: <bd...@bd...> - 2004-12-18 13:28:28
|
Author: bdash Date: 2004-12-19 02:28:22 +1300 (Sun, 19 Dec 2004) New Revision: 317 Modified: branches/libmsn-experimental/Makefile Log: Unique labels. Blah. Modified: branches/libmsn-experimental/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/libmsn-experimental/Makefile 2004-12-18 13:27:02 UTC (rev 31= 6) +++ branches/libmsn-experimental/Makefile 2004-12-18 13:28:22 UTC (rev 31= 7) @@ -1,10 +1,10 @@ ifndef TOOLS -error: +error1: @echo "Usage: make TOOLS=3D<boost toolset> BOOST_ROOT=3D<path to boost>= " endif =20 ifndef BOOST_ROOT -error: +error2: @echo "Usage: make TOOLS=3D<boost toolset> BOOST_ROOT=3D<path to boost>= " endif =20 |