Hello Christopher,
I've written a small program for you to reproduce the mentioned issue.
Just download and compile the latest live555 version and test this with it.
It seems that libcurl always expect a body from a GET_PARAMETER request, but 
usually an empty GP should work as keepalive for a RTSP connection.
Please let me know if you need anything else.

Many thanks !

Massimo



________________________________
Da: Christopher Conroy <[email protected]>
A: libcurl development <[email protected]>
Inviato: Mar 23 marzo 2010, 16:25:36
Oggetto: Re: CURL_RTSPREQ_GET_PARAMETER timout

On Tue, Mar 23, 2010 at 6:20 AM, Massimo Callegari
<[email protected]> wrote:
>
> Hello everybody.
> I am developing a small RTSP client to receive data from a live555 server.
> Everything goes fine until I start to use the CURL_RTSPREQ_GET_PARAMETER 
> method.
> In RTSP this is usually used to send a keepalive to the server. When I send 
> it the curl_easy_perform gets stuck for one minute before returning 200 OK. 
> After that any other command sent to the server returns "RTSP/1.0 405 Method 
> Not Allowed".
> I tried to set a 5 seconds timeout, which reduce the operation timout but the 
> 405 error remains there, so no other operation is possible.
>
> Has anyone experienced this so far ?
> Is this an internal libcurl fault or am I misunderstanding something ?
>
> Thanks in advance
> Massimo

Massimo, if possible could you send a small program that reproduces
the issue for you? I should be able to look into this tonight, but if
I have a test case in hand it will be a lot easier to debug. At the
very least, a tcpdump of the RTSP interaction between your app and the
server would be helpful.

--Chris
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html



      
/****************************************************************************
 * INCLUDES
 ****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <curl/curl.h>

int main(int argc, char *argv[])
{
  CURL  *csession;
  CURLcode res;
  struct curl_slist *custom_msg = NULL;

  char URL[256];
  char request[256];
  long rc;
  int port = 48000;

  if (argc < 2)
  {
      fprintf (stderr, "ERROR: enter a valid URL\n");
      return -1;
  }

  csession = curl_easy_init();

  if (csession == NULL)
      return -1;
  
  sprintf (URL, "%s", argv[1]);
  
  curl_easy_setopt(csession, CURLOPT_URL, URL);
  curl_easy_setopt(csession, CURLOPT_RTSP_STREAM_URI, URL);
  curl_easy_setopt(csession, CURLOPT_FOLLOWLOCATION, 1);
  curl_easy_setopt(csession, CURLOPT_HEADER, 1);

  /** retrieve OPTIONS */
  curl_easy_setopt(csession, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
  res = curl_easy_perform(csession);
  
  res = curl_easy_getinfo(csession, CURLINFO_RESPONSE_CODE, &rc);
  if((res == CURLE_OK) && rc)
  {
      fprintf(stderr, "OPTIONS Response Code: %ld\n\n", rc);
  }
  else
      return -1;  

  /** send DESCRIBE */  
  custom_msg = curl_slist_append(custom_msg, "Accept: application/x-rtsp-mh, 
application/rtsl, application/sdp");
  curl_easy_setopt(csession, CURLOPT_RTSPHEADER, custom_msg);
  curl_easy_setopt(csession, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_DESCRIBE);
  res = curl_easy_perform(csession);

  res = curl_easy_getinfo(csession, CURLINFO_RESPONSE_CODE, &rc);
  if((res == CURLE_OK) && rc)
  {
      fprintf(stderr, "DESCRIBE Response Code: %ld\n\n", rc);
  }
  else
      return -1;

  /** send SETUP */
  sprintf (request, "MP2T/H2221/UDP;unicast;client_port=%d", port);
  curl_easy_setopt(csession, CURLOPT_RTSP_TRANSPORT, request);
  curl_easy_setopt(csession, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP);
  res = curl_easy_perform(csession);
  
  res = curl_easy_getinfo(csession, CURLINFO_RESPONSE_CODE, &rc);
  if((res == CURLE_OK) && rc)
  {
      fprintf(stderr, "SETUP Response Code: %ld\n\n", rc);
  }
  else
      return -1;

  /** send PLAY */
  curl_easy_setopt(csession, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_PLAY);
  res = curl_easy_perform(csession);

  res = curl_easy_getinfo(csession, CURLINFO_RESPONSE_CODE, &rc);
  if((res == CURLE_OK) && rc)
  {
      fprintf(stderr, "PLAY Response Code: %ld\n\n", rc);
  }
  else
      return -1;

  /** send GET_PARAMETER */
  curl_easy_setopt(csession, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_GET_PARAMETER);
  res = curl_easy_perform(csession);
  res = curl_easy_getinfo(csession, CURLINFO_RESPONSE_CODE, &rc);
  if((res == CURLE_OK) && rc)
  {
      fprintf(stderr, "GET_PARAMETER Response Code: %ld\n\n", rc);
  }
  else
      return -1;

  /** send TEARDOWN */
  curl_easy_setopt(csession, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_TEARDOWN);
  res = curl_easy_perform(csession);

  res = curl_easy_getinfo(csession, CURLINFO_RESPONSE_CODE, &rc);
  if((res == CURLE_OK) && rc)
  {
      fprintf(stderr, "TEARDOWN Response Code: %ld\n\n", rc);
  }
  else
      return -1;
  
  curl_easy_cleanup(csession);
    
  return 0;
}



-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to