Changeset 5371:309ea408873b in roaraudio


Ignore:
Timestamp:
12/21/11 18:58:36 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added new error codes

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • include/roaraudio/error.h

    r5094 r5371  
    118118#define ROAR_ERROR_CONNRSTNET  96 /* Connection reset by network */ 
    119119#define ROAR_ERROR_CONNABORTED 97 /* Connection aborted */ 
     120#define ROAR_ERROR_BADHOST     98 /* Bad host software or hardware */ 
     121#define ROAR_ERROR_SWITCHPROTO 99 /* Switch protocol */ 
     122#define ROAR_ERROR_MOVEDPERM  100 /* Moved Permanently */ 
     123#define ROAR_ERROR_MOVEDTEMP  101 /* Moved Temporary */ 
     124#define ROAR_ERROR_USEPROXY   102 /* Use Proxy server */ 
     125#define ROAR_ERROR_SEEOTHER   103 /* See other resource */ 
     126#define ROAR_ERROR_GONE       104 /* Resource gone */ 
    120127 
    121128#endif 
  • libroar/error.c

    r5312 r5371  
    10561056  {ROAR_ERROR_CONNRSTNET,  "Connection reset by network"}, 
    10571057  {ROAR_ERROR_CONNABORTED, "Connection aborted"}, 
     1058  {ROAR_ERROR_BADHOST,     "Bad host software or hardware"}, 
     1059  {ROAR_ERROR_SWITCHPROTO, "Switch protocol"}, 
     1060  {ROAR_ERROR_MOVEDPERM,   "Moved Permanently"}, 
     1061  {ROAR_ERROR_MOVEDTEMP,   "Moved Temporary"}, 
     1062  {ROAR_ERROR_USEPROXY,    "Use Proxy server"}, 
     1063  {ROAR_ERROR_SEEOTHER,    "See other resource"}, 
     1064  {ROAR_ERROR_GONE,        "Resource gone"}, 
    10581065  {-1, NULL} 
    10591066 }, msgs_funny[] = { 
     
    11461153//  {ROAR_ERROR_CONNRSTNET,  "Connection reset by network"}, 
    11471154//  {ROAR_ERROR_CONNABORTED, "Connection aborted"}, 
     1155//  {ROAR_ERROR_BADHOST,     "Bad host software or hardware"}, 
     1156//  {ROAR_ERROR_SWITCHPROTO, "Switch protocol"}, 
     1157//  {ROAR_ERROR_MOVEDPERM,   "Moved Permanently"}, 
     1158//  {ROAR_ERROR_MOVEDTEMP,   "Moved Temporary"}, 
     1159//  {ROAR_ERROR_USEPROXY,    "Use Proxy server"}, 
     1160//  {ROAR_ERROR_SEEOTHER,    "See other resource"}, 
     1161//  {ROAR_ERROR_GONE,        "Resource gone"}, 
    11481162  {-1, NULL} 
    11491163 }; 
    11501164 int i; 
    11511165 
    1152  if ( config->opmode == ROAR_LIBROAR_CONFIG_OPMODE_MS ) 
    1153   for (i = 0; msgs[i].msg != NULL; i++) 
    1154    if ( msgs[i].err == error ) 
     1166 if ( config->opmode == ROAR_LIBROAR_CONFIG_OPMODE_MS ) { 
     1167  for (i = 0; msgs[i].msg != NULL; i++) { 
     1168   if ( msgs[i].err == error ) { 
    11551169    return roar_error2str_ms(error, msgs[i].msg); 
     1170   } 
     1171  } 
     1172  return roar_error2str_ms(error, "<<<unknown error>>>"); 
     1173 } 
    11561174 
    11571175 if ( config->opmode == ROAR_LIBROAR_CONFIG_OPMODE_FUNNY ) 
  • libroar/roardl.c

    r5353 r5371  
    146146 // check if both appnames are NULL or non-NULL. 
    147147 if ( (para->appname == NULL && appname != NULL) || (para->appname != NULL && appname == NULL) ) { 
    148   roar_err_set(ROAR_ERROR_BADVERSION); 
     148  roar_err_set(ROAR_ERROR_BADHOST); 
    149149  return -1; 
    150150 } 
     
    152152 // check if the appname matches if given. 
    153153 if ( para->appname != NULL && !!strcmp(para->appname, appname) ) { 
    154   roar_err_set(ROAR_ERROR_BADVERSION); 
     154  roar_err_set(ROAR_ERROR_BADHOST); 
    155155  return -1; 
    156156 } 
Note: See TracChangeset for help on using the changeset viewer.