-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send points to backend thru post instead of get #4211
Comments
We removed POST support a while ago: #2182 For your use-case what could make more sense is to
instead of bringing POST support back to osrm-routed. https://github.com/Project-OSRM/osrm-backend#using-the-nodejs-bindings |
Hmm. While @diegocando how are you making requests? Are you sure it isn't your client library that is creating the limit? From memory, I've tested large command-line requests with |
Hi Daniel, Dan, thank you for your answers. @danpat , it's a good idea, but in the client side I'm using c# web so the request still is limited to IIS, I'll try to make some workaround to test your way that is a good one. @daniel-j-h , I have a question, why POST was discarded? it seems like a smaller effort to implement post in the current project than changing to node.js or liborsm (the change will be a way better solution but will take some time extra, this will be the 2nd phase of the project but a bit later) but using async_read_some gets a partial from the request, but according to boost documentation async_read suits the case, but I'm stuck trying to implement this. this is what I've done in connection.cpp void Connection::start()
} void Connection::handle_read(const boost::system::error_code &error, std::size_t bytes_transfer$
std::string aux = incoming_data_buffer.data(); if (current_request.uri.find("table") > 0 && current_request.uri.length() < 20) |
@diegocando Are you accessing If you're using the |
@danpat osrm-routed have its own server using the regular osrm-routed server, the iis is in the same network but on a different server. |
@diegocando I just re-tested I created a 4.2MB
I used
(this request took about 2 minutes to respond, and returned 70MB of data). To support requests of this size, you need to run If you're getting connection drops from |
For completeness: this block of code in https://github.com/Project-OSRM/osrm-backend/blob/master/src/server/connection.cpp#L104 the size of a single HTTP request is not limited to the size of the read buffer. The |
Closing as not actionable on our side. |
Hi guys, using the URI has a limit within who invokes the call, wget have no limits but another client does(iis, tomcat, etc), I'm sharing the solution I get to partialy implement a post request in the osrm-routed service, this might enable a better support for future versions. The files I modified was: Hope this help someone that might be seeking the same as me. |
This seems like a bad design choice - I'm using c# HttpClient to interact with the OSRM API. I'm running into maximum URL length issues which would not exist if a POST were possible. Simply forcing users to use some http client library (nodejs's) which is for all practicality the -only- http client not imposing such a limit is of course an answer, but that requires consumers of the API to proxy the request through a nodejs layer. Also any kind of load balancing is greatly more complex. The entire world uses post to send lots of data to a server. Get was never intended for this use. If anything i'd advocate for removing the GET path if it is too much of a hassle to maintain both GET and POSTs |
@RichardVogelij I'd class it less as a "bad design choice" and more of a "nobody has needed this feature enough to spend time to implement it yet". Hint hint. I assume the limit you're hitting is this one?
One thing that might help temporarily is to control the precision of your coordinates - I often see requests with 10+ decimal places for each coordinate, which is totally unnecessary. If you're doing that, reducing it to 5 or 6 can save you some chars in the URL. |
Hi, thanks for your reply - Yes - i was refering to this limit indeed - In all honesty this only started to happen when I started experimenting with adding hints from previously obtained "nearest" requests in an attempt to find out if I was not missing out on a possible performance boost. These hints are quite significant b64 strings, and when I add those i reach that threshold of 65.5K characters in no time when generating a table/weight matrix. For the record - adding that hint data to my table request did not seem to give any difference - So I've stopped adding this data anyway - I'm well below the 65K threshold again. I was just -really- surprised to find: #2163 and felt this is a step in the wrong direction. OSRM is however an awesome project by the way! |
Hi, I'm using OSRM 5.3.0 and doing some modifications because the amount of points sent thru uri are way too long and the connection is dropped, I've tried to implement this by myself but failed.
I changed the connection.cpp file to substring incomming_data_buffer, but seems that async_read_some trimms the content of the call.
can anybody tell me how do you implemented this? any lead?
I've also tried with async_recieve -> the connection isnt dropped but the received content is also trimmed
I've changed connection.hpp to change from 8k to 2m the size of incomming_data_buffer but still trimm the content receieved.
Also tried to use boost::asio::async_read but something is missing, the connection doesnt finishes besides transfered all the content (checked using sniffer)
The text was updated successfully, but these errors were encountered: