From MAILER-DAEMON Sun Jun 11 04:12:24 2006
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1FpL3Y-0007QE-CQ
	for mharc-bug-commoncpp@gnu.org; Sun, 11 Jun 2006 04:12:24 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1FpL3V-0007O6-O2
	for bug-commoncpp@gnu.org; Sun, 11 Jun 2006 04:12:21 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1FpL3U-0007NH-7J
	for Bug-commoncpp@gnu.org; Sun, 11 Jun 2006 04:12:20 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1FpL3T-0007N8-Ko
	for Bug-commoncpp@gnu.org; Sun, 11 Jun 2006 04:12:19 -0400
Received: from [72.21.53.35] (helo=talk.nabble.com)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32)
	(Exim 4.52) id 1FpLBv-0003CQ-O9
	for Bug-commoncpp@gnu.org; Sun, 11 Jun 2006 04:21:03 -0400
Received: from localhost ([127.0.0.1] helo=talk.nabble.com)
	by talk.nabble.com with esmtp (Exim 4.50) id 1FpL3R-0002IK-Mb
	for Bug-commoncpp@gnu.org; Sun, 11 Jun 2006 01:12:17 -0700
Message-ID: <4814714.post@talk.nabble.com>
Date: Sun, 11 Jun 2006 01:03:51 -0700 (PDT)
From: verfranc <verfranc@gmail.com>
To: Bug-commoncpp@gnu.org
MIME-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_9643_16002819.1150013537694"
X-Nabble-Sender: verfranc@gmail.com
X-Nabble-From: verfranc <verfranc@gmail.com>
Cc: 
Subject: C++ String to C buffer
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Jun 2006 08:12:22 -0000

------=_Part_9643_16002819.1150013537694
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Hi,

I have a C++ program compiled under g++ 4.  This program was running good
when it was compiled under g++ 3.  Under g++ 4, this program exits w/o any
error msg.  I have traced the code that caused this problem.  The code is :
...
char myInput[100];
...
string strInput = "1234567890abcdefg";
...
memset(myInput, '\0',  100);
strcpy((char*)myInput, strInput.c_str());     // This is where it hangs or
exits
...


So I successfully re-code this to :
...
unsigned char* myInput;
...

string strInput = "1234567890abcdefg";
...
myInput = (unsigned char*)mallac(100);
if (!myInput) {
  return;
}
memset(myInput, '\0', 100);
strcpy((char*)myInput, strInput.c_str());
...


Is it not right to copy a C++ String to a C buffer? What's the difference if
I copy a C++ String to a pointer to a string?  By the way, I have compiled
the above code using the default parameters of g++.

Thanks,
Van


--
View this message in context: http://www.nabble.com/C%2B%2B-String-to-C-buffer-t1768999.html#a4814714
Sent from the Gnu - Common C++ forum at Nabble.com.

------=_Part_9643_16002819.1150013537694
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit


Hi,

I have a C++ program compiled under g++ 4.  This program was running good when it was compiled under g++ 3.  Under g++ 4, this program exits w/o any error msg.  I have traced the code that caused this problem.  The code is :
...
char myInput[100];
...
string strInput = "1234567890abcdefg";
...
memset(myInput, '\0',  100);
strcpy((char*)myInput, strInput.c_str());     // This is where it hangs or exits
...


So I successfully re-code this to :
...
unsigned char* myInput;
...

string strInput = "1234567890abcdefg";
...
myInput = (unsigned char*)mallac(100);
if (!myInput) {
  return;
}
memset(myInput, '\0', 100);
strcpy((char*)myInput, strInput.c_str());
...


Is it not right to copy a C++ String to a C buffer? What's the difference if I copy a C++ String to a pointer to a string?  By the way, I have compiled the above code using the default parameters of g++.

Thanks,
Van


<br><hr align="left" width="300">
View this message in context: <a href="http://www.nabble.com/C%2B%2B-String-to-C-buffer-t1768999.html#a4814714">C++ String to C buffer</a><br>
Sent from the <a href="http://www.nabble.com/Gnu---Common-C%2B%2B-f1535.html">Gnu - Common C++</a> forum at Nabble.com.<br>

------=_Part_9643_16002819.1150013537694--




From MAILER-DAEMON Thu Jun 29 10:52:00 2006
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Fvxs8-0004BR-5Q
	for mharc-bug-commoncpp@gnu.org; Thu, 29 Jun 2006 10:52:00 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Fvxs6-00047l-FG
	for bug-commoncpp@gnu.org; Thu, 29 Jun 2006 10:51:58 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1Fvxs4-00044F-Ma
	for bug-commoncpp@gnu.org; Thu, 29 Jun 2006 10:51:57 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Fvxs4-00043y-AF
	for bug-commoncpp@gnu.org; Thu, 29 Jun 2006 10:51:56 -0400
Received: from [192.11.222.161] (helo=ihemail1.lucent.com)
	by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fvy4d-0007PM-62
	for bug-commoncpp@gnu.org; Thu, 29 Jun 2006 11:04:55 -0400
Received: from oh0012exch001p.wins.lucent.com (h135-7-157-6.lucent.com
	[135.7.157.6])
	by ihemail1.lucent.com (8.12.11/8.12.11) with ESMTP id k5TEpsh3016466
	for <bug-commoncpp@gnu.org>; Thu, 29 Jun 2006 09:51:54 -0500 (CDT)
Received: by oh0012exch001p.cb.lucent.com with Internet Mail Service
	(5.5.2657.72) id <K1W99RZ5>; Thu, 29 Jun 2006 10:51:54 -0400
Message-ID: <0C6AA2145B810F499C69B0947DC5078106D6E6CA@oh0012exch001p.cb.lucent.com>
From: "Jones, Mark A (Mark)" <jones@lucent.com>
To: "'bug-commoncpp@gnu.org'" <bug-commoncpp@gnu.org>
Date: Thu, 29 Jun 2006 10:51:46 -0400
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2657.72)
Content-Type: text/plain;
	charset="iso-8859-1"
Cc: 
Subject: Need help in using the URLStream::post() method
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Jun 2006 14:51:59 -0000

Hi,

I recently downloaded commpncpp2-1.0.13 and I'm trying to use it in a prototype application
using the POST method.  Is there some detailed documentation on how the URLStream::post() method
works?  eg, how do I control the HTTP headers, how do I provide the entity(ies) that I 
want the server to receive?  Is there an example program that shows how the URLStream::post()
method may be used?  If yes, then please let me know where I can find it.

Any comments, questions, patches, and/or bug reports should be sent to "bug-commoncpp@gnu.org".                                               

Thanx,

Mark Jones
614-367-4576

Just do the right thing


Mark Jones
614-367-4576

Just do the right thing




From MAILER-DAEMON Thu Jun 29 14:14:45 2006
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Fw12L-0006Si-Bs
	for mharc-bug-commoncpp@gnu.org; Thu, 29 Jun 2006 14:14:45 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1FvxjL-0002ZC-Sq
	for bug-commoncpp@gnu.org; Thu, 29 Jun 2006 10:42:55 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1FvxjK-0002X3-77
	for bug-commoncpp@gnu.org; Thu, 29 Jun 2006 10:42:55 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1FvxjK-0002Wp-33
	for bug-commoncpp@gnu.org; Thu, 29 Jun 2006 10:42:54 -0400
Received: from [192.11.222.161] (helo=ihemail1.lucent.com)
	by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fvxvt-0006jM-2h
	for bug-commoncpp@gnu.org; Thu, 29 Jun 2006 10:55:53 -0400
Received: from oh0012exch001p.wins.lucent.com (h135-7-157-6.lucent.com
	[135.7.157.6])
	by ihemail1.lucent.com (8.12.11/8.12.11) with ESMTP id k5TEgp7G005436
	for <bug-commoncpp@gnu.org>; Thu, 29 Jun 2006 09:42:51 -0500 (CDT)
Received: by oh0012exch001p.cb.lucent.com with Internet Mail Service
	(5.5.2657.72) id <K1W99RPT>; Thu, 29 Jun 2006 10:42:51 -0400
Message-ID: <0C6AA2145B810F499C69B0947DC5078106D6E6C8@oh0012exch001p.cb.lucent.com>
From: "Jones, Mark A (Mark)" <jones@lucent.com>
To: "'bug-commoncpp@gnu.org'" <bug-commoncpp@gnu.org>
Date: Thu, 29 Jun 2006 10:42:44 -0400
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2657.72)
Content-Type: text/plain;
	charset="iso-8859-1"
X-Mailman-Approved-At: Thu, 29 Jun 2006 14:14:36 -0400
Cc: 
Subject: Need help in using the URLStream::post() method
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Jun 2006 14:42:56 -0000

Hi,

I recently downloaded commpncpp2-1.0.13 and I'm trying to use it in a prototype application
using the POST method.  Is there some detailed documentation on how the URLStream::post() method
works?  eg, how do I control the HTTP headers, how do I provide the entity(ies) that I 
want the server to receive?  Is there an example program that shows how the URLStream::post()
method may be used?  If yes, then please let me know where I can find it.

Any comments, questions, patches, and/or bug reports should be sent to "bug-commoncpp@gnu.org".                                               

Thanx,

Mark Jones
614-367-4576

Just do the right thing




