您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DEBUG1函数代码示例

51自学网 2021-06-01 20:19:22
  C++
这篇教程C++ DEBUG1函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中DEBUG1函数的典型用法代码示例。如果您正苦于以下问题:C++ DEBUG1函数的具体用法?C++ DEBUG1怎么用?C++ DEBUG1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了DEBUG1函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: fserve_shutdown

void fserve_shutdown(void){    fserve_running = 0;    if (mimetypes)        avl_tree_free (mimetypes, _delete_mapping);    if (fh_cache)    {        int count = 20;        avl_delete (fh_cache, &no_file, NULL);        while (fh_cache->length > 1 && count)        {            DEBUG1 ("waiting for %u entries to clear", fh_cache->length);            thread_sleep (100000);            count--;        }        avl_tree_free (fh_cache, _delete_fh);    }    thread_spin_destroy (&pending_lock);#ifndef HAVE_PREAD    thread_mutex_destroy (&seekread_lock);#endif    INFO0("file serving stopped");}
开发者ID:Johnny-Cache,项目名称:icecast-kh,代码行数:24,


示例2: stats_clear_virtual_mounts

/* This removes any source stats from virtual mountpoints, ie mountpoints * where no source_t exists. This function requires the global sources lock * to be held before calling. */void stats_clear_virtual_mounts (void){    avl_node *snode;    thread_mutex_lock (&_stats_mutex);    snode = avl_get_first(_stats.source_tree);    while (snode)    {        stats_source_t *src = (stats_source_t *)snode->key;        source_t *source = source_find_mount_raw (src->source);        if (source == NULL)        {            /* no source_t is reserved so remove them now */            snode = avl_get_next (snode);            DEBUG1 ("releasing %s stats", src->source);            avl_delete (_stats.source_tree, src, _free_source_stats);            continue;        }        snode = avl_get_next (snode);    }    thread_mutex_unlock (&_stats_mutex);}
开发者ID:dcorbe,项目名称:icecast,代码行数:28,


示例3: DEBUG

// ---------------------------------------------------------// CWlanMgmtCommandHandler::SetUapsdSettings// ---------------------------------------------------------//void CWlanMgmtCommandHandler::SetUapsdSettings(    TMaxServicePeriodLength aMaxServicePeriodLength,    TBool aUapsdEnabledForVoice,    TBool aUapsdEnabledForVideo,    TBool aUapsdEnabledForBestEffort,    TBool aUapsdEnabledForBackground )    {    DEBUG( "CWlanMgmtCommandHandler::SetUapsdSettings()" );        TConfigureUapsdMsg msg;    msg.hdr.oid_id = E802_11_CONFIGURE_UAPSD;    msg.maxServicePeriodLength = aMaxServicePeriodLength;    msg.uapsdForVoice = aUapsdEnabledForVoice;    msg.uapsdForVideo = aUapsdEnabledForVideo;    msg.uapsdForBestEffort = aUapsdEnabledForBestEffort;    msg.uapsdForBackground = aUapsdEnabledForBackground;    TPckg<TConfigureUapsdMsg> buf( msg );#ifdef _DEBUG    DEBUG1( "CWlanMgmtCommandHandler::SetUapsdSettings() - maxServicePeriodLength: 0x%02X",        msg.maxServicePeriodLength );    DEBUG1( "CWlanMgmtCommandHandler::SetUapsdSettings() - uapsdForVoice: %u",        msg.uapsdForVoice );    DEBUG1( "CWlanMgmtCommandHandler::SetUapsdSettings() - uapsdForVideo: %u",        msg.uapsdForVideo );    DEBUG1( "CWlanMgmtCommandHandler::SetUapsdSettings() - uapsdForBestEffort: %u",        msg.uapsdForBestEffort );    DEBUG1( "CWlanMgmtCommandHandler::SetUapsdSettings() - uapsdForBackground: %u",        msg.uapsdForBackground );#endif // _DEBUG                TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );    if( err )        {        DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );        TRequestStatus* status = &iStatus;        User::RequestComplete( status, err );        }    SetActive();      }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:44,


示例4: buffer_get_data

size_t buffer_get_data (buf_t *buf, char *data, long nbytes){  int write_amount;  int orig_size;  orig_size = nbytes;  DEBUG("Enter buffer_get_data");  pthread_cleanup_push(buffer_mutex_unlock, buf);  LOCK_MUTEX(buf->mutex);  /* Put the data into the buffer as space is made available */  while (nbytes > 0) {    if (buf->abort_write)      break;    DEBUG("Obtaining lock on buffer");    /* Block until we can read something */    if (buf->curfill == 0 && buf->eos)      break; /* No more data to read */    if (buf->curfill == 0 || (buf->prebuffering && !buf->eos)) {      DEBUG("Waiting for more data to copy.");      COND_WAIT(buf->playback_cond, buf->mutex);    }    if (buf->abort_write)      break;    /* Note: Even if curfill is still 0, nothing bad will happen here */    /* For simplicity, the number of bytes played must satisfy       the following three requirements:       1. Do not copy more bytes than are stored in the buffer.       2. Do not copy more bytes than the reqested data size.       3. Do not run off the end of the buffer. */    write_amount = compute_dequeue_size(buf, nbytes);    UNLOCK_MUTEX(buf->mutex);    execute_actions(buf, &buf->actions, buf->position);    /* No need to lock mutex here because the other thread will       NEVER reduce the number of bytes stored in the buffer */    DEBUG1("Copying %d bytes from the buffer", write_amount);    memcpy(data, buf->buffer + buf->start, write_amount);    LOCK_MUTEX(buf->mutex);    buf->curfill -= write_amount;    data += write_amount;    nbytes -= write_amount;    buf->start = (buf->start + write_amount) % buf->size;    DEBUG1("Updated buffer fill, curfill = %ld", buf->curfill);    /* Signal a waiting decoder thread that they can put more       audio into the buffer */    DEBUG("Signal decoder thread that buffer space is available");    COND_SIGNAL(buf->write_cond);  }  UNLOCK_MUTEX(buf->mutex);  pthread_cleanup_pop(0);  pthread_testcancel();  DEBUG("Exit buffer_get_data");  return orig_size - nbytes;}
开发者ID:Chocobo1,项目名称:vorbis-tools,代码行数:73,


示例5: wurfld_do_nothing

static void wurfld_do_nothing(int sig) {    DEBUG1("Signal %d received ... doing nothing/n", sig);}
开发者ID:passani,项目名称:wurfld,代码行数:3,


示例6: submit_data_chunk

int submit_data_chunk (buf_t *buf, char *data, size_t size){  long   buf_write_pos; /* offset of first available write location */  size_t write_size;  DEBUG1("Enter submit_data_chunk, size %d", size);  pthread_cleanup_push(buffer_mutex_unlock, buf);  /* Put the data into the buffer as space is made available */  while (size > 0 && !buf->abort_write) {    /* Section 1: Write a chunk of data */    DEBUG("Obtaining lock on buffer");    LOCK_MUTEX(buf->mutex);    if (buf->size - buf->curfill > 0) {      /* Figure how much we can write into the buffer.  Requirements:	 1. Don't write more data than we have.	 2. Don't write more data than we have room for.	 3. Don't write past the end of the buffer. */      buf_write_pos = (buf->start + buf->curfill) % buf->size;      write_size = MIN3(size, buf->size - buf->curfill,			buf->size - buf_write_pos);      memcpy(buf->buffer + buf_write_pos, data, write_size);      buf->curfill += write_size;      data += write_size;      size -= write_size;      buf->position_end += write_size;      DEBUG1("writing chunk into buffer, curfill = %ld", buf->curfill);    }    else {      if (buf->cancel_flag || sig_request.cancel) {        UNLOCK_MUTEX(buf->mutex);        break;      }      /* No room for more data, wait until there is */      DEBUG("No room for data in buffer.  Waiting.");      COND_WAIT(buf->write_cond, buf->mutex);    }    /* Section 2: signal if we are not prebuffering, done       prebuffering, or paused */    if (buf->prebuffering && (buf->prebuffer_size <= buf->curfill)) {      DEBUG("prebuffering done")	buf->prebuffering = 0; /* done prebuffering */    }    if (!buf->prebuffering && !buf->paused) {      DEBUG("Signalling playback thread that more data is available.");      COND_SIGNAL(buf->playback_cond);    } else      DEBUG("Not signalling playback thread since prebuffering or paused.");    UNLOCK_MUTEX(buf->mutex);  }  pthread_cleanup_pop(0);  DEBUG("Exit submit_data_chunk");  return !buf->abort_write;}
开发者ID:Chocobo1,项目名称:vorbis-tools,代码行数:65,


示例7: fserve_client_create

//.........这里部分代码省略.........        char *protocol = "http";        const char *agent = httpp_getvar (httpclient->parser, "user-agent");        int x;        char scratch[1000];        if (agent)        {            if (strstr (agent, "QTS") || strstr (agent, "QuickTime"))                protocol = "icy";        }        /* at least a couple of players (fb2k/winamp) are reported to send a          * host header but without the port number. So if we are missing the         * port then lets treat it as if no host line was sent */        if (host && strchr (host, ':') == NULL)            host = NULL;        *dot = 0;        if (httpclient->username && httpclient->password)        {            at = "@";            user = httpclient->username;            pass = httpclient->password;        }        httpclient->respcode = 200;        if (host == NULL)        {            config = config_get_config();            x = snprintf (scratch, sizeof scratch,                    "%s://%s%s%s%s%s:%d%s%s/r/n",                    protocol,                    user, at[0]?":":"", pass, at,                    config->hostname, config->port,                    sourceuri,                    args?args:"");            config_release_config();        }        else        {            x = snprintf (scratch, sizeof scratch,                    "%s://%s%s%s%s%s%s%s/r/n",                    protocol,                    user, at[0]?":":"", pass, at,                    host,                    sourceuri,                    args?args:"");        }        snprintf (httpclient->refbuf->data, BUFSIZE,                "HTTP/1.0 200 OK/r/n"                "Content-Length: %d/r/n"                "%s/r/n"                "Content-Type: audio/x-mpegurl/r/n/r/n%s",                x, client_keepalive_header (httpclient), scratch);        httpclient->refbuf->len = strlen (httpclient->refbuf->data);        free (sourceuri);        free (fullpath);        return fserve_setup_client_fb (httpclient, NULL);    }    if (xspf_requested && xspf_file_available == 0)    {        xmlDocPtr doc;        char *reference = strdup (path);        char *eol = strrchr (reference, '.');        if (eol)            *eol = '/0';        doc = stats_get_xml (0, reference);        free (reference);        free (fullpath);        return admin_send_response (doc, httpclient, XSLT, "xspf.xsl");    }    /* on demand file serving check */    config = config_get_config();    if (config->fileserve == 0)    {        config_release_config();        DEBUG1 ("on demand file /"%s/" refused", fullpath);        free (fullpath);        return client_send_404 (httpclient, "The file you requested could not be found");    }    config_release_config();    if (S_ISREG (file_buf.st_mode) == 0)    {        WARN1 ("found requested file but there is no handler for it: %s", fullpath);        free (fullpath);        return client_send_404 (httpclient, "The file you requested could not be found");    }    free (fullpath);    finfo.flags = 0;    finfo.mount = (char *)path;    finfo.fallback = NULL;    finfo.limit = 0;    finfo.type = FORMAT_TYPE_UNDEFINED;    snprintf (fsize, 20, "%" PRId64, (int64_t)file_buf.st_size);    httpp_setvar (httpclient->parser, "__FILESIZE", fsize);    stats_event_inc (NULL, "file_connections");    return fserve_setup_client_fb (httpclient, &finfo);}
开发者ID:onitake,项目名称:icecast-kh,代码行数:101,


示例8: pap_task

/*---------------------------------------------------------------------------*/voidpap_task(u8_t *buffer)	{  u8_t *bptr;  u16_t t;  PAPPKT *pkt;  /* If LCP is up and PAP negotiated, try to bring up PAP */  if(!(pap_state & PAP_TX_UP) && !(pap_state & PAP_TX_TIMEOUT)) {    /* Do we need to send a PAP auth packet?       Check if we have a request pending*/    if(1 == TIMER_timeout(PAP_TIMEOUT)) {      /* Check if we have a request pending */      /* t=get_seconds()-pap_tx_time;	 if(	t > pap_timeout)      {      */      /* We need to send a PAP authentication request */      DEBUG1(("/nSending PAP Request packet - "));      /* Build a PAP request packet */      pkt = (PAPPKT *)buffer;		            /* Configure-Request only here, write id */      pkt->code = CONF_REQ;      pkt->id = ppp_id;      bptr = pkt->data;            /* Write options */      t = strlen(pap_username);      /* Write peer length */      *bptr++ = (u8_t)t;	      bptr = memcpy(bptr, pap_username, t);      t = strlen(pap_password);      *bptr++ = (u8_t)t;      bptr = memcpy(bptr, pap_password, t);			      /* Write length */      t = bptr - buffer;      /* length here -  code and ID +  */      pkt->len = htons(t);	            DEBUG1((" Len %d/n",t));            /* Send packet */      ahdlc_tx(PAP, buffer, 0, t, 0);      /* Set timer */      TIMER_set();            ppp_retry++;      /* Have we failed? */      if(ppp_retry > 3) {	DEBUG1(("PAP - timout/n"));	pap_state &= PAP_TX_TIMEOUT;	      }    }  }}
开发者ID:ZhepingYang,项目名称:contiki-1.x,代码行数:63,


示例9: DEBUG1

/** * Create WebSocket structure * * @param sb pointer to SystemBase * @param port port on which WS will work * @param sslOn TRUE when WS must be secured through SSL, otherwise FALSE * @return pointer to new WebSocket structure, otherwise NULL */WebSocket *WebSocketNew( void *sb,  int port, FBOOL sslOn ){	WebSocket *ws = NULL;	SystemBase *lsb = (SystemBase *)sb;		DEBUG1("[WS] New websocket/n");		pthread_mutex_init( &WSThreadMutex, NULL );		if( ( ws = FCalloc( 1, sizeof( WebSocket ) ) ) != NULL )	{		char *fhome = getenv( "FRIEND_HOME" );		ws->ws_FCM = lsb->fcm;				ws->ws_Port = port;		ws->ws_UseSSL = sslOn;		ws->ws_OldTime = 0;		ws->ws_InterfaceName[ 0 ] = 0;		memset( &(ws->ws_Info), 0, sizeof ws->ws_Info );		ws->ws_Opts = 0;		ws->ws_Interface = NULL;				if( ws->ws_UseSSL == TRUE )		{			INFO("[WS] WebSocket: SSL Enabled/n");						ws->ws_CertPath = lsb->RSA_SERVER_CERT;			ws->ws_KeyPath = lsb->RSA_SERVER_KEY;						DEBUG1("[WS] server cert %s keycert %s/n", ws->ws_CertPath, ws->ws_KeyPath );					//sprintf( ws->ws_CertPath, "%s%s", fhome, "/libwebsockets-test-server.pem" );			//sprintf( ws->ws_KeyPath, "%s%s", fhome, "/libwebsockets-test-server.key.pem" );			//ws->ws_Opts |= LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS;		}				if( ws->ws_AllowNonSSL == TRUE )		{			 //ws->ws_Opts |= LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT;		}					/*		case 'k':			opts = LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK;			break;			*/		ws->ws_Info.port = ws->ws_Port;		ws->ws_Info.protocols = protocols;		ws->ws_Info.iface = ws->ws_Interface;		ws->ws_Info.gid = -1;		ws->ws_Info.uid = -1;		ws->ws_Info.extensions = NULL;		ws->ws_Info.ssl_cert_filepath = ws->ws_CertPath;		ws->ws_Info.ssl_private_key_filepath = ws->ws_KeyPath;		ws->ws_Info.options = ws->ws_Opts;// | LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT;		if( ws->ws_UseSSL == TRUE ) 		{			ws->ws_Info.options |= LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS|LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;		}				ws->ws_Info.user = ws;				//ws->ws_Info.extensions = lws_get_internal_extensions();		//ws->ws_Info.extensions->per_context_private_data = ws;		ws->ws_Info.ssl_cipher_list = "ECDHE-ECDSA-AES256-GCM-SHA384:"			       "ECDHE-RSA-AES256-GCM-SHA384:"			       "DHE-RSA-AES256-GCM-SHA384:"			       "ECDHE-RSA-AES256-SHA384:"			       "HIGH:!aNULL:!eNULL:!EXPORT:"			       "!DES:!MD5:!PSK:!RC4:!HMAC_SHA1:"			       "!SHA1:!DHE-RSA-AES128-GCM-SHA256:"			       "!DHE-RSA-AES128-SHA256:"			       "!AES128-GCM-SHA256:"			       "!AES128-SHA256:"			       "!DHE-RSA-AES256-SHA256:"			       "!AES256-GCM-SHA384:"			       "!AES256-SHA256";				ws->ws_CountPollfds = 0;				//ws->ws_Info.ka_time = 15;		//lws_set_log_level( 0, lwsl_emit_syslog);				ws->ws_Context = lws_create_context( &ws->ws_Info );		if( ws->ws_Context == NULL )		{			FERROR( "Libwebsocket init failed, cannot create context/n" );			FFree( ws );			return NULL;		}				INFO("[WS] NEW Websockets ptr %p context %p/n", ws, ws->ws_Context);//.........这里部分代码省略.........
开发者ID:eloekset,项目名称:friendup,代码行数:101,


示例10: sdl_visual_bitblt

voidsdl_visual_bitblt(VDI_Workstation * vwk,                  int               mode,                  RECT *            srccor,                  RECT *            dstcor,                  MFDB *            src,                  MFDB *            dst){  RECT tmpcor;  DEBUG3("sdl_visual_bitblt entered/n");  /* Fix the coordinates so that the width and the height of the   * rectangle are positive */  fix_rect(srccor);  fix_rect(dstcor);  /* Completely ignore what the user says what the destination      width and height should be and recalculate them here.     They must be recalculated after the fix. */  dstcor->x2 = srccor->x2 - srccor->x1 + dstcor->x1;  dstcor->y2 = srccor->y2 - srccor->y1 + dstcor->y1;  tmpcor = *dstcor;  /* check first if clipping takes away everything,     if destination is the screen */  if(!dst->fd_addr && !do_rectclip(dstcor, &vwk->clip)) {    return;  }  /* See if we can use GGI functions */  if( src->fd_addr == NULL ) {    /* Copy from screen */    if( dst->fd_addr == NULL ) {      /* to screen */      switch( mode ) {      case S_ONLY:        DEBUG1("Blit 1/n");        /*    	ggiCopyBox( VISUAL_T(vwk->visual->private),		    srccor->x1 + dstcor->x1 - tmpcor.x1,		    srccor->y1 + dstcor->y1 - tmpcor.y1,		    dstcor->x2 - dstcor->x1 + 1,		    dstcor->y2 - dstcor->y1 + 1,		    dstcor->x1,		    dstcor->y1);        */	return;	      case D_ONLY:	/* I am not sure that I understand the purpose of this */        DEBUG1("Blit 2/n");        /*    	ggiCopyBox( VISUAL_T(vwk->visual->private),		    dstcor->x1,		    dstcor->y1,		    dstcor->x2 - dstcor->x1 + 1,		    dstcor->y2 - dstcor->y1 + 1,		    dstcor->x1,		    dstcor->y1);        */	return;      default:      {	/* We assume that oVDIsis has already checked that the mode	 * is between 0 and 15	 * gargl, I bet this code is sloooooooow */	int           x,y;	int           w,h;        SDL_Surface * screen;        screen = VISUAL_T(vwk->visual->private);        if(SDL_MUSTLOCK(screen))        {          if(SDL_LockSurface(screen) < 0)          {            return;          }        }	w = min( srccor->x2 - srccor->x1  ,  dstcor->x2 - dstcor->x1 );	h = min( srccor->y2 - srccor->y1  ,  dstcor->y2 - dstcor->y1 );	for(y = 0; y < h; y++)        {	  for(x = 0;  x < w; x++)          {            Uint16 * srcp;            Uint16 * dstp;            /* FIXME: support other bit depths than 16 */            srcp = (Uint16 *)screen->pixels +              (srccor->y1 + y + dstcor->y1 - tmpcor.y1) * screen->pitch / 2 +              srccor->x1 + x + dstcor->x1 - tmpcor.x1;            dstp = (Uint16 *)screen->pixels +              (dstcor->y1 + y) * screen->pitch/2 + dstcor->x1 + x;//.........这里部分代码省略.........
开发者ID:e8johan,项目名称:ovdisis,代码行数:101,


示例11: got_packet

//.........这里部分代码省略.........		rad_free(&packet);		return;	}		switch (packet->code) {	case PW_COA_REQUEST:		/* we need a 16 x 0 byte vector for decrypting encrypted VSAs */		original = nullpacket;		break;	case PW_AUTHENTICATION_ACK:		/* look for a matching request and use it for decoding */		original = rbtree_finddata(request_tree, packet);		break;	case PW_AUTHENTICATION_REQUEST:		/* save the request for later matching */		original = rad_alloc_reply(NULL, packet);		if (original) { /* just ignore allocation failures */			rbtree_deletebydata(request_tree, original);			rbtree_insert(request_tree, original);		}		/* fallthrough */	default:		/* don't attempt to decode any encrypted attributes */		original = NULL;	}	/*	 *  Decode the data without bothering to check the signatures.	 */	if (rad_decode(packet, original, radius_secret) != 0) {		rad_free(&packet);		fr_perror("decode");		return;	}	/*	 *  We've seen a successfull reply to this, so delete it now	 */	if (original)		rbtree_deletebydata(request_tree, original);	if (filter_vps && filter_packet(packet)) {		rad_free(&packet);		DEBUG(log_dst, "Packet number %d doesn't match/n", count++);		return;	}	if (out) {		pcap_dump((void *) out, header, data);		goto check_filter;	}	INFO(log_dst, "%s Id %d/t", fr_packet_codes[packet->code], packet->id);	/*	 *  Print the RADIUS packet	 */	INFO(log_dst, "%s:%d -> ", inet_ntoa(ip->ip_src), ntohs(udp->udp_sport));	INFO(log_dst, "%s:%d", inet_ntoa(ip->ip_dst), ntohs(udp->udp_dport));		DEBUG1(log_dst, "/t(%d packets)", count++);		if (!start_pcap.tv_sec) {		start_pcap = header->ts;	}	tv_sub(&header->ts, &start_pcap, &elapsed);	INFO(log_dst, "/t+%u.%03u", (unsigned int) elapsed.tv_sec,	       (unsigned int) elapsed.tv_usec / 1000);		if (fr_debug_flag > 1) {		DEBUG(log_dst, "/n");		if (packet->vps) {			if (do_sort) sort(packet);				vp_printlist(log_dst, packet->vps);			pairfree(&packet->vps);		}	}		INFO(log_dst, "/n");		if (!to_stdout && (fr_debug_flag > 4)) {		rad_print_hex(packet);	}		fflush(log_dst); check_filter:	/*	 *  If we're doing filtering, Access-Requests are cached in the	 *  filter tree.	 */	if (!filter_vps ||	    ((packet->code != PW_AUTHENTICATION_REQUEST) &&	     (packet->code != PW_ACCOUNTING_REQUEST))) {		rad_free(&packet);	}}
开发者ID:jcartermeru,项目名称:freeradius-server,代码行数:101,


示例12: client_destroy

void client_destroy(client_t *client){    if (client == NULL)        return;    if (client->worker)    {        WARN0 ("client still on worker thread");        return;    }    /* release the buffer now, as the buffer could be on the source queue     * and may of disappeared after auth completes */    if (client->refbuf)    {        refbuf_release (client->refbuf);        client->refbuf = NULL;    }    if (client->flags & CLIENT_AUTHENTICATED)        DEBUG1 ("client still in auth /"%s/"", httpp_getvar (client->parser, HTTPP_VAR_URI));    /* write log entry if ip is set (some things don't set it, like outgoing      * slave requests     */    if (client->respcode > 0 && client->parser)        logging_access(client);    if (client->flags & CLIENT_IP_BAN_LIFT)    {        INFO1 ("lifting IP ban on client at %s", client->connection.ip);        connection_release_banned_ip (client->connection.ip);        client->flags &= ~CLIENT_IP_BAN_LIFT;    }    if (client->parser)        httpp_destroy (client->parser);    /* we need to free client specific format data (if any) */    if (client->free_client_data)        client->free_client_data (client);    free(client->username);    free(client->password);    client->username = NULL;    client->password = NULL;    client->parser = NULL;    client->respcode = 0;    client->free_client_data = NULL;    global_lock ();    if (global.running != ICE_RUNNING || client->connection.error ||            (client->flags & CLIENT_KEEPALIVE) == 0 || client_connected (client) == 0)    {        global.clients--;        stats_event_args (NULL, "clients", "%d", global.clients);        config_clear_listener (client->server_conn);        global_unlock ();        connection_close (&client->connection);        free(client);        return;    }    global_unlock ();    DEBUG0 ("keepalive detected, placing back onto worker");    client->counter = client->schedule_ms = timing_get_time();    client->connection.con_time = client->schedule_ms/1000;    client->connection.discon.time = client->connection.con_time + 7;    client->ops = &http_request_ops;    client->flags = CLIENT_ACTIVE;    client->shared_data = NULL;    client->refbuf = NULL;    client->pos = 0;    client->intro_offset = client->connection.sent_bytes = 0;    client_add_worker (client);}
开发者ID:8Media,项目名称:icecast-kh,代码行数:75,


示例13: DEBUG1

// ---------------------------------------------------------// CWlanMgmtCommandHandler::RunL// ---------------------------------------------------------//    void CWlanMgmtCommandHandler::RunL()    {    DEBUG1( "CWlanMgmtCommandHandler::RunL, status == %d", iStatus.Int() );    iClient.OnRequestComplete( iStatus.Int() );    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:9,


示例14: DEBUGm1

//.........这里部分代码省略.........    /* ---------------------------------------------------------------------- */    /* for each weak diagonal, find a pair of strong off-diagonal entries */    /* ---------------------------------------------------------------------- */    for (row = 0 ; row < n2 ; row++)    {	P [row] = EMPTY ;    }    unmatched = 0 ;    best = EMPTY ;    jdiff = EMPTY ;    jdeg = EMPTY ;    for (deg = mindeg ; deg <= maxdeg ; deg++)    {	/* find the next weak diagonal of lowest degree */	DEBUGm2 (("---------------------------------- Deg: "ID"/n", deg)) ;	for (k = Head [deg] ; k != EMPTY ; k = Next [k])	{	    DEBUGm2 (("k: "ID"/n", k)) ;	    if (P [k] == EMPTY)	    {		/* C (k,k) is a weak diagonal entry.  Find an index j != k such		 * that C (j,k) and C (k,j) are both strong, and also such		 * that Degree [j] is minimized.  In case of a tie, pick		 * the smallest index j.  C and R contain the pattern of		 * strong entries only.		 *		 * Note that row k of R and column k of C are both sorted. */		DEBUGm4 (("===== Weak diagonal k = "ID"/n", k)) ;		DEBUG1 (("Column k of C:/n")) ;		for (p = Cp [k] ; p < Cp [k+1] ; p++)		{		    DEBUG1 (("    "ID": deg "ID"/n", Ci [p], Degree [Ci [p]]));		}		DEBUG1 (("Row k of R (strong entries only):/n")) ;		for (p = Rp [k] ; p < Rp [k+1] ; p++)		{		    DEBUG1 (("    "ID": deg "ID"/n", Ri [p], Degree [Ri [p]]));		}		/* no (C (k,j), C (j,k)) pair exists yet */		j_best = EMPTY ;		jdiff_best = Int_MAX ;		jdeg_best = Int_MAX ;		/* pointers into column k (including values) */		cp1 = Cp [k] ;		cp2 = Cp [k+1] ;		cp = cp1 ;		/* pointers into row k (strong entries only, no values) */		rp1 = Rp [k] ;		rp2 = Rp [k+1] ;		rp = rp1 ;		/* while entries searched in column k and row k */		while (TRUE)		{		    if (cp >= cp2)		    {			/* no more entries in this column */
开发者ID:OpenModelica,项目名称:OMCompiler-3rdParty,代码行数:67,


示例15: DEBUG1

GLOBAL Int UMF_store_lu_drop#elseGLOBAL Int UMF_store_lu#endif(    NumericType *Numeric,    WorkType *Work){    /* ---------------------------------------------------------------------- */    /* local variables */    /* ---------------------------------------------------------------------- */    Entry pivot_value ;#ifdef DROP    double droptol ;#endif    Entry *D, *Lval, *Uval, *Fl1, *Fl2, *Fu1, *Fu2,	*Flublock, *Flblock, *Fublock ;    Int i, k, fnr_curr, fnrows, fncols, row, col, pivrow, pivcol, *Frows,	*Fcols, *Lpattern, *Upattern, *Lpos, *Upos, llen, ulen, fnc_curr, fnpiv,	uilen, lnz, unz, nb, *Lilen,	*Uilen, *Lip, *Uip, *Li, *Ui, pivcol_position, newLchain, newUchain,	pivrow_position, p, size, lip, uip, lnzi, lnzx, unzx, lnz2i, lnz2x,	unz2i, unz2x, zero_pivot, *Pivrow, *Pivcol, kk,	Lnz [MAXNB] ;#ifndef NDEBUG    Int *Col_degree, *Row_degree ;#endif#ifdef DROP    Int all_lnz, all_unz ;    droptol = Numeric->droptol ;#endif    /* ---------------------------------------------------------------------- */    /* get parameters */    /* ---------------------------------------------------------------------- */    fnrows = Work->fnrows ;    fncols = Work->fncols ;    fnpiv = Work->fnpiv ;    Lpos = Numeric->Lpos ;    Upos = Numeric->Upos ;    Lilen = Numeric->Lilen ;    Uilen = Numeric->Uilen ;    Lip = Numeric->Lip ;    Uip = Numeric->Uip ;    D = Numeric->D ;    Flublock = Work->Flublock ;    Flblock  = Work->Flblock ;    Fublock  = Work->Fublock ;    fnr_curr = Work->fnr_curr ;    fnc_curr = Work->fnc_curr ;    Frows = Work->Frows ;    Fcols = Work->Fcols ;#ifndef NDEBUG    Col_degree = Numeric->Cperm ;	/* for NON_PIVOTAL_COL macro */    Row_degree = Numeric->Rperm ;	/* for NON_PIVOTAL_ROW macro */#endif    Lpattern = Work->Lpattern ;    llen = Work->llen ;    Upattern = Work->Upattern ;    ulen = Work->ulen ;    nb = Work->nb ;#ifndef NDEBUG    DEBUG1 (("/nSTORE LU: fnrows "ID	" fncols "ID"/n", fnrows, fncols)) ;    DEBUG2 (("/nFrontal matrix, including all space:/n"		"fnr_curr "ID" fnc_curr "ID" nb    "ID"/n"		"fnrows   "ID" fncols   "ID" fnpiv "ID"/n",		fnr_curr, fnc_curr, nb, fnrows, fncols, fnpiv)) ;    DEBUG2 (("/nJust the active part:/n")) ;    DEBUG7 (("C  block: ")) ;    UMF_dump_dense (Work->Fcblock,  fnr_curr, fnrows, fncols) ;    DEBUG7 (("L  block: ")) ;    UMF_dump_dense (Work->Flblock,  fnr_curr, fnrows, fnpiv);    DEBUG7 (("U' block: ")) ;    UMF_dump_dense (Work->Fublock,  fnc_curr, fncols, fnpiv) ;    DEBUG7 (("LU block: ")) ;    UMF_dump_dense (Work->Flublock, nb, fnpiv, fnpiv) ;    DEBUG7 (("Current frontal matrix: (prior to store LU)/n")) ;    UMF_dump_current_front (Numeric, Work, TRUE) ;#endif    Pivrow = Work->Pivrow ;    Pivcol = Work->Pivcol ;    /* ---------------------------------------------------------------------- *///.........这里部分代码省略.........
开发者ID:freshNfunky,项目名称:SuiteSparse-4.5.3,代码行数:101,


示例16: main

//.........这里部分代码省略.........	 */	request_tree = rbtree_create((rbcmp) fr_packet_cmp, free, 0);	if (!request_tree) {		fprintf(stderr, "radsniff: Failed creating request tree/n");		exit(1);	}	/*	 *  Allocate a null packet for decrypting attributes in CoA requests	 */	nullpacket = rad_alloc(NULL, 0);	if (!nullpacket) {		fprintf(stderr, "radsniff: Out of memory/n");		exit(1);	}	/*	 *  Get the default capture device	 */	if (!from_stdin && !from_file && !from_dev) {		from_dev = pcap_lookupdev(errbuf);		if (!from_dev) {			fprintf(stderr, "radsniff: Failed discovering default interface (%s)/n", errbuf);			exit(1);		}		INFO(log_dst, "Capturing from interface /"%s/"/n", from_dev);	}		/*	 *  Print captures values which will be used	 */	if (fr_debug_flag > 2) {				DEBUG1(log_dst, "Sniffing with options:/n");		if (from_dev)	DEBUG1(log_dst, "  Device		   : [%s]/n", from_dev);		if (limit > 0)	DEBUG1(log_dst, "  Capture limit (packets)  : [%d]/n", limit);				DEBUG1(log_dst, "  PCAP filter	      : [%s]/n", pcap_filter);				DEBUG1(log_dst, "  RADIUS secret	    : [%s]/n", radius_secret);		if (filter_vps){DEBUG1(log_dst, "  RADIUS filter	    :/n");			vp_printlist(log_dst, filter_vps);		}	}	/*	 *  Figure out whether were doing a reading from a file, doing a live	 *  capture or reading from stdin.	 */	if (from_file) {		in = pcap_open_offline(from_file, errbuf);#ifdef HAVE_PCAP_FOPEN_OFFLINE	} else if (from_stdin) {		in = pcap_fopen_offline(stdin, errbuf);#endif	} else if (from_dev) {		pcap_lookupnet(from_dev, &ip_addr, &ip_mask, errbuf);		in = pcap_open_live(from_dev, 65536, 1, 1, errbuf);	} else {		fprintf(stderr, "radsniff: No capture devices available/n");	}		if (!in) {		fprintf(stderr, "radsniff: Failed opening input (%s)/n", errbuf);		exit(1);	}	if (to_file) {
开发者ID:jcartermeru,项目名称:freeradius-server,代码行数:67,


示例17: DEBUG1

GLOBAL Int UMF_get_memory(    NumericType *Numeric,    WorkType *Work,    Int needunits,    Int r2,		/* compact current front to r2-by-c2 */    Int c2,    Int do_Fcpos){    double nsize, bsize, tsize ;    Int i, minsize, newsize, newmem, costly, row, col, *Row_tlen, *Col_tlen,	n_row, n_col, *Row_degree, *Col_degree ;    Unit *mnew, *p ;    /* ---------------------------------------------------------------------- */    /* get and check parameters */    /* ---------------------------------------------------------------------- */#ifndef NDEBUG    DEBUG1 (("::::GET MEMORY::::/n")) ;    UMF_dump_memory (Numeric) ;#endif    n_row = Work->n_row ;    n_col = Work->n_col ;    Row_degree = Numeric->Rperm ;	/* for NON_PIVOTAL_ROW macro */    Col_degree = Numeric->Cperm ;	/* for NON_PIVOTAL_COL macro */    Row_tlen   = Numeric->Uilen ;    Col_tlen   = Numeric->Lilen ;    /* ---------------------------------------------------------------------- */    /* initialize the tuple list lengths */    /* ---------------------------------------------------------------------- */    for (row = 0 ; row < n_row ; row++)    {	if (NON_PIVOTAL_ROW (row))	{	    Row_tlen [row] = 0 ;	}    }    for (col = 0 ; col < n_col ; col++)    {	if (NON_PIVOTAL_COL (col))	{	    Col_tlen [col] = 0 ;	}    }    /* ---------------------------------------------------------------------- */    /* determine how much memory is needed for the tuples */    /* ---------------------------------------------------------------------- */    nsize = (double) needunits + 2 ;    needunits += UMF_tuple_lengths (Numeric, Work, &tsize) ;    nsize += tsize ;    needunits += 2 ;	/* add 2, so that newmem >= 2 is true if realloc'd */    /* note: Col_tlen and Row_tlen are updated, but the tuple lists */    /* themselves are not.  Do not attempt to scan the tuple lists. */    /* They are now stale, and are about to be destroyed and recreated. */    /* ---------------------------------------------------------------------- */    /* determine the desired new size of memory */    /* ---------------------------------------------------------------------- */    DEBUG0 (("UMF_get_memory: needunits: "ID"/n", needunits)) ;    minsize = Numeric->size + needunits ;    nsize += (double) Numeric->size ;    bsize = ((double) Int_MAX) / sizeof (Unit) - 1 ;    newsize = (Int) (UMF_REALLOC_INCREASE * ((double) minsize)) ;    nsize *= UMF_REALLOC_INCREASE ;    nsize += 1 ;    if (newsize < 0 || nsize > bsize)    {	/* :: realloc Numeric->Memory int overflow :: */	DEBUGm3 (("Realloc hit integer limit/n")) ;	newsize = (Int) bsize ;	/* we cannot increase the size beyond bsize */    }    else    {	ASSERT (newsize <= nsize) ;	newsize = MAX (newsize, minsize) ;    }    newsize = MAX (newsize, Numeric->size) ;    DEBUG0 ((    "REALLOC MEMORY: needunits "ID" old size: "ID" new size: "ID" Units /n",	needunits, Numeric->size, newsize)) ;    /* Forget where the biggest free block is (we no longer need it) */    /* since garbage collection will occur shortly. */    Numeric->ibig = EMPTY ;    DEBUG0 (("Before realloc E [0] "ID"/n", Work->E [0])) ;//.........这里部分代码省略.........
开发者ID:GHilmarG,项目名称:Ua,代码行数:101,


示例18: WebSocketStart

/** * Websocket start thread function * * @param ws pointer to WebSocket structure * @return 0 when success, otherwise error number */int WebSocketStart( WebSocket *ws ){	DEBUG1("[WS] Starting websocket thread/n");	ws->ws_Thread = ThreadNew( WebsocketThread, ws, TRUE, NULL );	return 0;}
开发者ID:eloekset,项目名称:friendup,代码行数:12,


示例19: main

//.........这里部分代码省略.........	 */	if (!conf->from_stdin && !conf->from_file && !conf->from_dev) {		pcap_if_t *all_devices;			/* List of all devices libpcap can listen on */		pcap_if_t *dev_p;		if (pcap_findalldevs(&all_devices, errbuf) < 0) {			ERROR("Error getting available capture devices: %s", errbuf);			goto finish;		}		if (!all_devices) {			ERROR("No capture files specified and no live interfaces available");			ret = 64;			goto finish;		}		for (dev_p = all_devices;		     dev_p;		     dev_p = dev_p->next) {		     	/* Don't use the any devices, it's horribly broken */		     	if (!strcmp(dev_p->name, "any")) continue;			*in_head = fr_pcap_init(conf, dev_p->name, PCAP_INTERFACE_IN);			in_head = &(*in_head)->next;		}		conf->from_auto = true;		conf->from_dev = true;		INFO("Defaulting to capture on all interfaces");	}	/*	 *	Print captures values which will be used	 */	if (fr_debug_flag > 2) {			DEBUG1("Sniffing with options:");		if (conf->from_dev)	{			char *buff = fr_pcap_device_names(conf, in, ' ');			DEBUG1("  Device(s)                : [%s]", buff);			talloc_free(buff);		}		if (conf->to_file || conf->to_stdout) {			DEBUG1("  Writing to               : [%s]", out->name);		}		if (limit > 0)	{			DEBUG1("  Capture limit (packets)  : [%d]", limit);		}			DEBUG1("  PCAP filter              : [%s]", conf->pcap_filter);			DEBUG1("  RADIUS secret            : [%s]", conf->radius_secret);		if (filter_vps){			DEBUG1("  RADIUS filter            :");			vp_printlist(log_dst, filter_vps);		}	}	/*	 *	Open our interface to collectd	 */#ifdef HAVE_COLLECTDC_H	if (conf->stats.out == RS_STATS_OUT_COLLECTD) {		size_t i;		rs_stats_tmpl_t *tmpl, **next;		if (rs_stats_collectd_open(conf) < 0) {			exit(1);		}		next = &conf->stats.tmpl;
开发者ID:liuyanning,项目名称:freeradius-server,代码行数:67,


示例20: DEBUG

// ---------------------------------------------------------------------------// ---------------------------------------------------------------------------//core_frame_dot11_c* core_frame_dot11_c::instance(    u16_t data_length,    const u8_t* data,    bool_t is_copied )    {    DEBUG( "core_frame_dot11_c::instance()" );    DEBUG1( "core_frame_dot11_c::instance() - is_copied %u",        is_copied );           if( data_length < CORE_DOT11_LENGTH )        {        DEBUG( "core_frame_dot11_c::instance() - not a valid 802.11 frame, frame is too short" );                return NULL;        }    u8_t* buffer = const_cast<u8_t*>( data );    u16_t buffer_length( 0 );    if( is_copied )        {        buffer_length = data_length;        buffer = new u8_t[buffer_length];                if( !buffer )            {            DEBUG( "core_frame_dot11_c::instance() - not able to allocate buffer for copying" );                    return NULL;                        }        core_tools_c::copy(            buffer,            data,            buffer_length );        }    core_frame_dot11_c* instance = new core_frame_dot11_c(        data_length,        buffer,        buffer_length );    if( !instance )        {        DEBUG( "core_frame_dot11_c::instance() - unable to create an instance" );        if( is_copied )            {            delete[] buffer;            }        return NULL;        }    u16_t required_length( CORE_DOT11_LENGTH );    if( instance->is_qos_m )        {        required_length += CORE_DOT11_QOS_CONTROL_LENGTH;        DEBUG( "core_frame_dot11_c::instance() - this frame includes QoS Control field" );        }    if( instance->is_ht_m )        {        required_length += CORE_DOT11_HT_CONTROL_LENGTH;        DEBUG( "core_frame_dot11_c::instance() - this frame includes HT Control field" );        }    if( data_length < required_length )        {        DEBUG( "core_frame_dot11_c::instance() - not a valid 802.11 frame, frame is too short" );        delete instance;        return NULL;        }    return instance;    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:80,


示例21: ipcp_rx

void ipcp_rx(struct ppp_context_s *ctx, u8_t *buffer, u16_t count){  u8_t *bptr = buffer;  //IPCPPKT *pkt=(IPCPPKT *)buffer;  u16_t len;  DEBUG1(("IPCP len %d/n",count));  switch (*bptr++)  {  case CONF_REQ:    /* Parse request and see if we can ACK it */    ++bptr;    len = (*bptr++ << 8);    len |= *bptr++;    /* len-=2; */    DEBUG1(("check lcplist/n"));    if (scan_packet(ctx, IPCP, ipcplist, buffer, bptr, (u16_t)(len - 4)))      {        DEBUG1(("option was bad/n"));      }    else      {        DEBUG1(("IPCP options are good/n"));        /* Parse out the results */        /* lets try to implement what peer wants */        /* Reject any protocol not */        /* Error? if we we need to send a config Reject ++++ this is good for a subroutine*/        /* All we should get is the peer IP address */        if (IPCP_IPADDRESS == *bptr++)          {            /* Dump length */            ++bptr;#ifdef IPCP_GET_PEER_IP            ((u8_t*)&ctx->peer_ip)[0] = *bptr++;            ((u8_t*)&ctx->peer_ip)[1] = *bptr++;            ((u8_t*)&ctx->peer_ip)[2] = *bptr++;            ((u8_t*)&ctx->peer_ip)[3] = *bptr++;            DEBUG1(("Peer IP "));            /* printip(peer_ip_addr); */            DEBUG1(("/n"));            netlib_set_dripv4addr((char*)ctx->ifname, &ctx->peer_ip);#else            bptr += 4;#endif          }        else          {            DEBUG1(("HMMMM this shouldn't happen IPCP1/n"));          }#if 0        if (error)          {            /* Write the config NAK packet we've built above, take on the header */            bptr = buffer;            *bptr++ = CONF_NAK;        /* Write Conf_rej */            *bptr++;            /*tptr++;*/  /* skip over ID */            /* Write new length */            *bptr++ = 0;            *bptr = tptr - buffer;            /* Write the reject frame */            DEBUG1(("Writing NAK frame /n"));            ahdlc_tx(IPCP, buffer, (u16_t)(tptr - buffer));            DEBUG1(("- End NAK Write frame/n"));          }        else          {          }#endif        /* If we get here then we are OK, lets send an ACK and tell the rest         * of our modules our negotiated config.         */        ctx->ipcp_state |= IPCP_RX_UP;        DEBUG1(("Send IPCP ACK!/n"));        bptr = buffer;        *bptr++ = CONF_ACK; /* Write Conf_ACK */        bptr++;             /* Skip ID (send same one) */        /* Set stuff */        /* ppp_flags |= tflag; */        DEBUG1(("SET- stuff -- are we up? c=%d dif=%d /n", count, (u16_t)(bptr - buffer)));        /* Write the ACK frame *///.........这里部分代码省略.........
开发者ID:CompagnieDesLampadaires,项目名称:terrarium_2015,代码行数:101,


示例22: fserve_scan

void fserve_scan (time_t now){    avl_node *node;    avl_tree_wlock (fh_cache);    node = avl_get_first (fh_cache);    while (node)    {        fh_node *fh = node->key;        node = avl_get_next (node);        thread_mutex_lock (&fh->lock);        if (global.running != ICE_RUNNING)            fh->expire = 0;        if (now == (time_t)0)        {            fh->expire = 0;            thread_mutex_unlock (&fh->lock);            continue;        }        if (fh->finfo.limit)        {            fbinfo *finfo = &fh->finfo;            if (fh->stats == 0)            {                int len = strlen (finfo->mount) + 10;                char *str = alloca (len);                char buf[20];                snprintf (str, len, "%s-%s", (finfo->flags & FS_FALLBACK) ? "fallback" : "file", finfo->mount);                fh->stats = stats_handle (str);                stats_set_flags (fh->stats, "fallback", "file", STATS_COUNTERS|STATS_HIDDEN);                stats_set_flags (fh->stats, "outgoing_kbitrate", "0", STATS_COUNTERS|STATS_HIDDEN);                snprintf (buf, sizeof (buf), "%d", fh->refcount);                stats_set_flags (fh->stats, "listeners", buf, STATS_GENERAL|STATS_HIDDEN);                snprintf (buf, sizeof (buf), "%d", fh->peak);                stats_set_flags (fh->stats, "listener_peak", buf, STATS_GENERAL|STATS_HIDDEN);                fh->prev_count = fh->refcount;            }            else            {                stats_lock (fh->stats, NULL);                if (fh->prev_count != fh->refcount)                {                    fh->prev_count = fh->refcount;                    stats_set_args (fh->stats, "listeners", "%ld", fh->refcount);                    stats_set_args (fh->stats, "listener_peak", "%ld", fh->peak);                }            }            if (fh->stats_update <= now)            {                fh->stats_update = now + 5;                stats_set_args (fh->stats, "outgoing_kbitrate", "%ld",                        (long)((8 * rate_avg (fh->out_bitrate))/1024));            }            stats_release (fh->stats);        }        if (fh->refcount == 0 && fh->expire >= 0 && now >= fh->expire)        {            DEBUG1 ("timeout of %s", fh->finfo.mount);            if (fh->stats)            {                stats_lock (fh->stats, NULL);                stats_set (fh->stats, NULL, NULL);            }            remove_fh_from_cache (fh);            thread_mutex_unlock (&fh->lock);            _delete_fh (fh);            continue;        }        thread_mutex_unlock (&fh->lock);    }    avl_tree_unlock (fh_cache);}
开发者ID:onitake,项目名称:icecast-kh,代码行数:74,


示例23: ipcp_task

void ipcp_task(struct ppp_context_s *ctx, u8_t *buffer){  u8_t *bptr;  u16_t    t;  IPCPPKT *pkt;  /* IPCP tx not up and hasn't timed out then lets see if we need to     send a request */  if (!(ctx->ipcp_state & IPCP_TX_UP) && !(ctx->ipcp_state & IPCP_TX_TIMEOUT))    {      /* Check if we have a request pending */      if ((ppp_arch_clock_seconds() - ctx->ipcp_prev_seconds) > IPCP_TIMEOUT)        {          ctx->ipcp_prev_seconds = ppp_arch_clock_seconds();          /* No pending request, lets build one */          pkt=(IPCPPKT *)buffer;          /* Configure-Request only here, write id */          pkt->code = CONF_REQ;          pkt->id = ctx->ppp_id;          bptr = pkt->data;          /* Write options, we want IP address, and DNS addresses if set. */          /* Write zeros for IP address the first time */          *bptr++ = IPCP_IPADDRESS;          *bptr++ = 0x6;          *bptr++ = (u8_t)((u8_t*)&ctx->local_ip)[0];          *bptr++ = (u8_t)((u8_t*)&ctx->local_ip)[1];          *bptr++ = (u8_t)((u8_t*)&ctx->local_ip)[2];          *bptr++ = (u8_t)((u8_t*)&ctx->local_ip)[3];#ifdef IPCP_GET_PRI_DNS          if (!(ppp_ipcp_state & IPCP_PRI_DNS_BIT))            {              /* Write zeros for IP address the first time */              *bptr++ = IPCP_PRIMARY_DNS;              *bptr++ = 0x6;              *bptr++ = ((u8_t*)&ctx->pri_dns_addr)[0];              *bptr++ = ((u8_t*)&ctx->pri_dns_addr)[1];              *bptr++ = ((u8_t*)&ctx->pri_dns_addr)[2];              *bptr++ = ((u8_t*)&ctx->pri_dns_addr)[3];            }#endif#ifdef IPCP_GET_SEC_DNS          if (!(ppp_ipcp_state & IPCP_SEC_DNS_BIT))            {              /* Write zeros for IP address the first time */              *bptr++ = IPCP_SECONDARY_DNS;              *bptr++ = 0x6;              *bptr++ = ((u8_t*)&ctx->sec_dns_addr)[0];              *bptr++ = ((u8_t*)&ctx->sec_dns_addr)[1];              *bptr++ = ((u8_t*)&ctx->sec_dns_addr)[2];              *bptr++ = ((u8_t*)&ctx->sec_dns_addr)[3];            }#endif          /* Write length */          t = bptr - buffer;          /* length here -  code and ID + */          pkt->len = htons(t);          DEBUG1(("/n**Sending IPCP Request packet/n"));          /* Send packet ahdlc_txz(procol,header,data,headerlen,datalen); */          ahdlc_tx(ctx, IPCP, 0, buffer, 0, t);          /* Inc retry */          ctx->ipcp_retry++;          /* Have we timed out? (combine the timers?) */          if (ctx->ipcp_retry > IPCP_RETRY_COUNT)            {              ctx->ipcp_state &= IPCP_TX_TIMEOUT;            }        }    }}
开发者ID:CompagnieDesLampadaires,项目名称:terrarium_2015,代码行数:93,


示例24: printip

void printip(uip_ipaddr_t ip2){  char *ip = (u8_t*)ip2;  DEBUG1((" %d.%d.%d.%d ",ip[0],ip[1],ip[2],ip[3]));}
开发者ID:CompagnieDesLampadaires,项目名称:terrarium_2015,代码行数:5,


示例25: while

bool CompilerInterface::responseFileToArgumentList (const std::string& rsp_file,Argv &args) const{  FUNCTION_TRACE;  bool res=false;  args.clear();  FILE *f=fopen(rsp_file.c_str(),"r");  if (f)  {    int sz;    std::string text;    char tmp[CHAINE_LEN*16];    text.clear();    while ( (sz=fread(tmp,sizeof(char),CHAINE_LEN*16,f)) > 0)      text+=std::string(tmp,sz);        fclose(f);    if (!text.empty())    {      std::string rsptext;      switch (text_encoding(text))      {        case ENC_UTF16:          { // Windows .NET 2005 workaround            DEBUG1("UTF16 Response file/n");            wchar_t tmp[CHAINE_LEN];            wchar_t *textws=NULL;            int sz;            int tmp_sz=0;            char *text=NULL;            f=fopen(rsp_file.c_str(),"rb");            if (f==NULL) return false;            while ( (sz=fread(tmp,sizeof(wchar_t),CHAINE_LEN,f)) > 0)            {              textws=(wchar_t *)REALLOC(textws,sizeof(wchar_t)*(sz+tmp_sz));              memcpy(&textws[tmp_sz],tmp,sz*sizeof(wchar_t));              tmp_sz+=sz;            }            fclose(f);            text=(char*)MALLOC(sizeof(char)*(tmp_sz+1+CHAINE_LEN));            memset(text,0,tmp_sz+1);            int offset=0;            while (textws[offset]==0xFEFF)              offset++;            DEBUG2("offset=%i/n",offset);            wcstombs(text,&textws[offset],tmp_sz-offset);            text[tmp_sz-offset]='/0';            DEBUG2("Response file contain:%s/n",text);#if LOG            for (int i=0;i<tmp_sz;i++)            {               DEBUG5("textws[%i]=%4.4X text[%i]=%c/n",i,textws[i],i,text[i]);            }#endif            FREE(textws);            rsptext=std::string(text);            FREE(text);          }               break;        case ENC_UTF8:          DEBUG1("UTF8 Response file/n");          rsptext=utf16_to_ascii(utf8_to_utf16(text));          break;        case ENC_ASCII:          DEBUG1("ASCII Response file/n");          rsptext=text;          break;      }      rsptext=ascii_correct_eol(rsptext);      if (!rsptext.empty())      {        DEBUG2("Response file contain:%s/n",rsptext.c_str());        rsptext+="/n"; // add a separator at the end to simplify the process        res=responseFileContainsToArgumentList(rsptext,args);      }    }  }  return res;}
开发者ID:testcocoon,项目名称:testcocoon,代码行数:82,


示例26: DEBUG

void *buffer_thread_func (void *arg){  buf_t *buf = (buf_t*) arg;  size_t write_amount;  DEBUG("Enter buffer_thread_func");  buffer_thread_init(buf);  pthread_cleanup_push(buffer_thread_cleanup, buf);  DEBUG("Start main play loop");  /* This test is safe since curfill will never decrease and eos will     never be unset. */  while ( !(buf->eos && buf->curfill == 0) && !buf->abort_write) {    if (buf->cancel_flag || sig_request.cancel)      break;    DEBUG("Check for something to play");    /* Block until we can play something */    LOCK_MUTEX (buf->mutex);    if (buf->prebuffering || 	buf->paused || 	(buf->curfill < buf->audio_chunk_size && !buf->eos)) {      DEBUG("Waiting for more data to play.");      COND_WAIT(buf->playback_cond, buf->mutex);    }    DEBUG("Ready to play");    UNLOCK_MUTEX(buf->mutex);    if (buf->cancel_flag || sig_request.cancel)      break;    /* Don't need to lock buffer while running actions since position       won't change.  We clear out any actions before we compute the       dequeue size so we don't consider actions that need to       run right now.  */    execute_actions(buf, &buf->actions, buf->position);    LOCK_MUTEX(buf->mutex);    /* Need to be locked while we check things. */    write_amount = compute_dequeue_size(buf, buf->audio_chunk_size);    UNLOCK_MUTEX(buf->mutex);     if(write_amount){ /* we might have been woken spuriously */      /* No need to lock mutex here because the other thread will         NEVER reduce the number of bytes stored in the buffer */      DEBUG1("Sending %d bytes to the audio device", write_amount);      write_amount = buf->write_func(buf->buffer + buf->start, write_amount,                                     /* Only set EOS if this is the last chunk */                                     write_amount == buf->curfill ? buf->eos : 0,                                     buf->write_arg);      if (!write_amount) {        DEBUG("Error writing to the audio device. Aborting.");        buffer_abort_write(buf);      }      LOCK_MUTEX(buf->mutex);      buf->curfill -= write_amount;      buf->position += write_amount;      buf->start = (buf->start + write_amount) % buf->size;      DEBUG1("Updated buffer fill, curfill = %ld", buf->curfill);      /* If we've essentially emptied the buffer and prebuffering is enabled,         we need to do another prebuffering session */      if (!buf->eos && (buf->curfill < buf->audio_chunk_size))        buf->prebuffering = buf->prebuffer_size > 0;    }else{      DEBUG("Woken spuriously");    }    /* Signal a waiting decoder thread that they can put more audio into the       buffer */    DEBUG("Signal decoder thread that buffer space is available");    COND_SIGNAL(buf->write_cond);    UNLOCK_MUTEX(buf->mutex);  }  pthread_cleanup_pop(1);  DEBUG("exiting buffer_thread_func");  return 0;}
开发者ID:Chocobo1,项目名称:vorbis-tools,代码行数:93,



注:本文中的DEBUG1函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ DEBUG2函数代码示例
C++ DEBUG0函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。