[OSM-dev] Code works on sandbox API, doesn't work on main API

Janos Rusiczki kitsched-bot at clicktrackheart.com
Wed Dec 2 11:02:59 GMT 2009


I have installed a packet sniffer and the weird thing is that on the POST
HEX tab of the application for the sandbox API I see the XML being passed
while on the main API it's empty. Also request body size is 0 for the main
API call while it's 189 bytes for the sandbox API call.

It seems as if CURL is not sending any data to lighttpd. So how can I force
it to do so?

---

AND I FIXED IT!

The missing "magic" line was:
curl_setopt($ch, CURLOPT_INFILESIZE, filesize('tmp/tmpfile'));

With this it works on the main API too!

---

Thanks for your help guys, without the sniffer idea I wouldn't have gotten
far.

On Wed, Dec 2, 2009 at 12:51 PM, Peter Körner <osm-lists at mazdermind.de>wrote:

> Tom Hughes schrieb:
> > On 02/12/09 10:10, Janos Rusiczki wrote:
> >> I have replaced the input file with the XML you provided.
> >> Result: the exact same error.
> >> And obviously it works like a charm on the sandbox
> >> (api06.dev.openstreetmap.org <http://api06.dev.openstreetmap.org>).
> >> I'm running out of hair to pull.
> >
> > There's nothing wrong with the XML - it parses just fine using the live
> > code on the live server.
> >
> > My suspicion is that you're seeing a problem with curl and lighttpd not
> > getting on and as a result the body of the request is not making it to
> > the rails code properly. That would also explain why it works on dev, as
> > that uses apache.
> >
> > A network trace of exactly what request curl is sending and getting back
> > might help understand more what the problem is.
> >
> > Tom
> >
>
> You may just add --trace-ascii mytrace.txt to your curl call (it's
> --debug with wget)
>
> Alternatively you may use a tool like Paros Proxy (a local standalone
> HTTP Proxy) to trace all your calls.
>
> Peter
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20091202/d69e7b1c/attachment.html>


More information about the dev mailing list