• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/curl/curl-7.36.0/lib/

Lines Matching refs:data

73  * Parse and write out any available RTP data.
75 * nread: amount of data left after k->str. will be modified if RTP
76 * data is parsed and k->str is moved up
77 * readmore: whether or not the RTP parser needs more data right away
79 static CURLcode rtsp_rtp_readwrite(struct SessionHandle *data,
132 conn->data->req.protop = rtsp = calloc(1, sizeof(struct RTSP));
141 * The server may send us RTP data at any point, and RTSPREQ_RECEIVE does not
146 * and distinguish between closed and data.
162 else if((sval & CURL_CSELECT_IN) && check->data) {
165 curl_socket_t connectinfo = Curl_getconnectinfo(check->data, &check);
176 struct SessionHandle *data = conn->data;
181 if(data->state.rtsp_next_client_CSeq == 0)
182 data->state.rtsp_next_client_CSeq = 1;
183 if(data->state.rtsp_next_server_CSeq == 0)
184 data->state.rtsp_next_server_CSeq = 1;
202 struct SessionHandle *data = conn->data;
203 struct RTSP *rtsp = data->req.protop;
209 if(data->set.rtspreq == RTSPREQ_RECEIVE)
218 if((data->set.rtspreq != RTSPREQ_RECEIVE) && (CSeq_sent != CSeq_recv)) {
219 failf(data,
224 else if(data->set.rtspreq == RTSPREQ_RECEIVE &&
226 infof(data, "Got an RTP Receive with a CSeq of %ld\n", CSeq_recv);
236 struct SessionHandle *data = conn->data;
238 Curl_RtspReq rtspreq = data->set.rtspreq;
239 struct RTSP *rtsp = data->req.protop;
261 rtsp->CSeq_sent = data->state.rtsp_next_client_CSeq;
269 data->set.opt_no_body = TRUE; /* most requests don't contain a body */
272 failf(data, "Got invalid RTSP request: RTSPREQ_NONE");
279 data->set.opt_no_body = FALSE;
299 data->set.opt_no_body = FALSE;
310 data->set.opt_no_body = FALSE;
313 failf(data, "Got invalid RTSP request: RTSPREQ_LAST");
324 p_session_id = data->set.str[STRING_RTSP_SESSION_ID];
327 failf(data, "Refusing to issue an RTSP request [%s] without a session ID.",
336 if(data->set.str[STRING_RTSP_STREAM_URI]) {
337 p_stream_uri = data->set.str[STRING_RTSP_STREAM_URI];
344 p_transport = Curl_checkheaders(data, "Transport:");
347 if(data->set.str[STRING_RTSP_TRANSPORT]) {
352 data->set.str[STRING_RTSP_TRANSPORT]);
357 failf(data,
368 p_accept = Curl_checkheaders(data, "Accept:")?
372 if(!Curl_checkheaders(data, "Accept-Encoding:") &&
373 data->set.str[STRING_ENCODING]) {
376 aprintf("Accept-Encoding: %s\r\n", data->set.str[STRING_ENCODING]);
389 if(Curl_checkheaders(data, "User-Agent:") && conn->allocptr.uagent) {
393 else if(!Curl_checkheaders(data, "User-Agent:") &&
394 data->set.str[STRING_USERAGENT]) {
400 if(data->change.referer && !Curl_checkheaders(data, "Referer:"))
401 conn->allocptr.ref = aprintf("Referer: %s\r\n", data->change.referer);
413 if(data->state.use_range &&
417 if(!Curl_checkheaders(data, "Range:") && data->state.range) {
419 conn->allocptr.rangeline = aprintf("Range: %s\r\n", data->state.range);
427 if(Curl_checkheaders(data, "CSeq:")) {
428 failf(data, "CSeq cannot be set as a custom header.");
431 if(Curl_checkheaders(data, "Session:")) {
432 failf(data, "Session ID cannot be set as a custom header.");
482 result = Curl_add_timecondition(data, req_buffer);
495 if(data->set.upload) {
496 putsize = data->set.infilesize;
497 data->set.httpreq = HTTPREQ_PUT;
501 postsize = (data->set.postfieldsize != -1)?
502 data->set.postfieldsize:
503 (data->set.postfields? (curl_off_t)strlen(data->set.postfields):0);
504 data->set.httpreq = HTTPREQ_POST;
510 if(!Curl_checkheaders(data, "Content-Length:")) {
513 (data->set.upload ? putsize : postsize));
520 if(!Curl_checkheaders(data, "Content-Type:")) {
529 if(!Curl_checkheaders(data, "Content-Type:")) {
537 data->state.expect100header = FALSE; /* RTSP posts are simple/small */
541 data->set.httpreq = HTTPREQ_HEAD;
542 data->set.opt_no_body = TRUE;
547 data->req.forbidchunk = TRUE;
554 result = Curl_add_buffer(req_buffer, data->set.postfields,
562 &data->info.request_size, 0, FIRSTSOCKET);
564 failf(data, "Failed sending RTSP request");
573 data->state.rtsp_next_client_CSeq++;
578 Curl_pgrsSetUploadCounter(data, http->writebytecount);
587 static CURLcode rtsp_rtp_readwrite(struct SessionHandle *data,
591 struct SingleRequest *k = &data->req;
594 char *rtp; /* moving pointer to rtp data */
595 ssize_t rtp_dataleft; /* how much data left to parse in this round */
600 /* There was some leftover data the last time. Merge buffers */
640 DEBUGF(infof(data, "RTP write channel %d rtp_length %d\n",
644 failf(data, "Got an error writing an RTP packet");
656 if(data->set.rtspreq == RTSPREQ_RECEIVE) {
672 DEBUGF(infof(data, "RTP Rewinding %zd %s\n", rtp_dataleft,
688 /* As far as the transfer is concerned, this data is consumed */
696 /* either all of the data has been read or...
718 struct SessionHandle *data = conn->data;
723 failf (data, "Cannot write a 0 size RTP packet.");
727 writeit = data->set.fwrite_rtp?data->set.fwrite_rtp:data->set.fwrite_func;
728 wrote = writeit(ptr, 1, len, data->set.rtp_out);
731 failf (data, "Cannot pause RTP");
736 failf (data, "Failed writing RTP data");
746 struct SessionHandle *data = conn->data;
753 struct RTSP *rtsp = data->req.protop;
755 data->state.rtsp_CSeq_recv = CSeq; /* update the handle */
758 failf(data, "Unable to read the CSeq header: [%s]", header);
771 failf(data, "Got a blank Session ID");
773 else if(data->set.str[STRING_RTSP_SESSION_ID]) {
775 if(strncmp(start, data->set.str[STRING_RTSP_SESSION_ID],
776 strlen(data->set.str[STRING_RTSP_SESSION_ID])) != 0) {
777 failf(data, "Got RTSP Session ID Line [%s], but wanted ID [%s]",
778 start, data->set.str[STRING_RTSP_SESSION_ID]);
799 data->set.str[STRING_RTSP_SESSION_ID] = malloc(end - start + 1);
800 if(data->set.str[STRING_RTSP_SESSION_ID] == NULL)
802 memcpy(data->set.str[STRING_RTSP_SESSION_ID], start, end - start);
803 (data->set.str[STRING_RTSP_SESSION_ID])[end - start] = '\0';