Ejemplo n.º 1
0
void mupnp_ssdprequest_setleasetime(mUpnpSSDPRequest *ssdpReq, mUpnpTime value)
{
	char buf[sizeof(MUPNP_HTTP_MAX_AGE) + 1 + MUPNP_STRING_INTEGER_BUFLEN];
	
	mupnp_log_debug_l4("Entering...\n");

	sprintf(buf, "%s=%ld", MUPNP_HTTP_MAX_AGE, (long)value);
	mupnp_http_packet_setheadervalue((mUpnpHttpPacket*)ssdpReq, MUPNP_HTTP_CACHE_CONTROL, buf);

	mupnp_log_debug_l4("Leaving...\n");
}
Ejemplo n.º 2
0
void mupnp_event_subscription_response_settimeout(mUpnpSubscriptionResponse* subRes, long value)
{
  mUpnpString* buf;

  mupnp_log_debug_l4("Entering...\n");

  buf = mupnp_string_new();
  mupnp_http_packet_setheadervalue((mUpnpHttpPacket*)subRes, MUPNP_HTTP_TIMEOUT, mupnp_event_subscription_totimeoutheaderstring(value, buf));
  mupnp_string_delete(buf);

  mupnp_log_debug_l4("Leaving...\n");
}
Ejemplo n.º 3
0
void mupnp_event_subscription_request_settimeout(mUpnpSubscriptionRequest* subReq, long timeout)
{
  mUpnpString* timeoutBuf;

  mupnp_log_debug_l4("Entering...\n");

  timeoutBuf = mupnp_string_new();
  mupnp_http_packet_setheadervalue(((mUpnpHttpPacket*)subReq), MUPNP_HTTP_TIMEOUT, mupnp_event_subscription_totimeoutheaderstring(timeout, timeoutBuf));
  mupnp_string_delete(timeoutBuf);

  mupnp_log_debug_l4("Leaving...\n");
}
Ejemplo n.º 4
0
void mupnp_event_subscription_subscriberesponse_setresponse(mUpnpSubscriptionResponse* subRes, int code)
{
  char server[MUPNP_SEVERNAME_MAXLEN];
  mupnp_log_debug_l4("Entering...\n");

  mupnp_http_response_setstatuscode(subRes, code);
  mupnp_getservername(server, sizeof(server));
  mupnp_http_packet_setheadervalue(((mUpnpHttpPacket*)subRes),
      MUPNP_HTTP_SERVER,
      server);
  mupnp_http_response_setcontentlength(subRes, 0);

  mupnp_log_debug_l4("Leaving...\n");
}
Ejemplo n.º 5
0
void mupnp_event_subscription_response_setsid(mUpnpSubscriptionResponse* subRes, const char* sid)
{
  mUpnpString* headerSID;
  ssize_t uuidIdx;

  mupnp_log_debug_l4("Entering...\n");

  headerSID = mupnp_string_new();

  uuidIdx = mupnp_strstr(sid, MUPNP_ST_UUID_DEVICE);
  if (uuidIdx < 0)
    mupnp_string_addvalue(headerSID, MUPNP_ST_UUID_DEVICE ":");
  mupnp_string_addvalue(headerSID, sid);

  mupnp_http_packet_setheadervalue(((mUpnpHttpPacket*)subRes), MUPNP_HTTP_SID, mupnp_string_getvalue(headerSID));

  mupnp_string_delete(headerSID);

  mupnp_log_debug_l4("Leaving...\n");
}