bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some questions on URLStream::post()


From: Joachim Wilke
Subject: Some questions on URLStream::post()
Date: Tue, 14 Dec 2010 19:56:36 +0100

Dear all,

I am currently migrating my own implementations of threads and socket
communication in libfritz++ to commoncpp. Libfritz++ is a C++ lib for
communication with AVMs Fritz!Boxes (a DSL-Router and wireless access
point broadly used in Germany) that is used in multiple applications
(e.g. Kfritz - a KDE frontend).

Migration to Thread and TCPStream classes worked flawlessly. However I
have some issues with URLStream::post()

- Doing a simple HTTP POST the library appends "\r\n" to the POST
data. The Fritz!Box webserver however gets confused by that. Consider
the following example:

  POST  /login HTTP/1.0\r\n
  Connection: close\r\n
  Content-Length: 29\r\n
  \r\n
  user=sample&password=secret\r\n

  The Fritz!Box now thinks the password is "secret\r\n". Should the
Fritz!Box be able to handle this POST request according to the HTTP
specification or is this a bug in URLStream?
  My current workaround is to append an '&' to the password, so that
the data reads 'user=sample&password=secret&\r\n'.

- Doing a multipart HTTP POST the library uses "boundry" in the
Content-Type header. Shouldn't this be "boundary"?

- Another issue with multipart HTTP POST is, that the Fritz!Box
answers such a request with "HTTP 411 - length required". Wireshark
traces showed, that the Fritz!Box responds immediately after the
header has been sent and does not wait for the post's body. Any idea
how to avoid that?

-- 
Best Regards,
Joachim.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]