Hello

I'm trying to post an image file to restlet server with curl, but I
can't. Curl uses the expect header, which is - afaik - not supported
by restlet. I set the Expect header to an empty string, but the
connection still hangs.

Has anyone managed to POST a 30k-sized file to restlet?

--------------
[EMAIL PROTECTED]:~/tmp/zatom$ curl -v -X POST --data-binary
"@kepmindenkirol.jpg"  http://localhost:8182/test
* About to connect() to localhost port 8182 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8182 (#0)
> POST /test HTTP/1.1
> User-Agent: curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g 
> zlib/1.2.3.3 libidn/1.1
> Host: localhost:8182
> Accept: */*
> Content-Length: 36294
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>

after a while press Ctrl + C

Then restlet logs this:

Aug 2, 2008 12:57:07 AM com.noelios.restlet.http.HttpServerConverter commit
INFO: The connection was broken. It was probably closed by the client.
java.io.IOException: Broken pipe
        at sun.nio.ch.FileDispatcher.write0(Native Method)
        at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29)
        at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
        at sun.nio.ch.IOUtil.write(IOUtil.java:75)
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)
        at java.nio.channels.Channels.write(Channels.java:60)
        at java.nio.channels.Channels.access$000(Channels.java:47)
        at java.nio.channels.Channels$1.write(Channels.java:134)
        at java.io.OutputStream.write(OutputStream.java:58)
        at java.nio.channels.Channels$1.write(Channels.java:115)
        at 
com.noelios.restlet.http.HttpServerCall.writeResponseHead(HttpServerCall.java:579)
        at 
com.noelios.restlet.http.StreamServerCall.writeResponseHead(StreamServerCall.java:177)
        at 
com.noelios.restlet.http.HttpServerCall.sendResponse(HttpServerCall.java:473)
        at 
com.noelios.restlet.http.HttpServerConverter.commit(HttpServerConverter.java:358)
        at 
com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java:138)
        at 
com.noelios.restlet.http.StreamServerHelper$ConnectionHandler.run(StreamServerHelper.java:75)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
----------------


Thanks in advance

zsolt

Reply via email to