133#include <sys\types.h>
143#include <netinet/in.h>
146#include <sys/types.h>
149#include <sys/socket.h>
151#include <sys/socket.h>
189 char cModule[32]=
"rawAddStrings";
208 iString1 = strlen(pcMsg1);
209 iString2 = strlen(pcMsg2);
210 iString = iString1 + iString2;
214 fprintf(
fLogFile,
"\n-D- begin %s\n", cModule);
215 fprintf(
fLogFile,
" string1 (%d byte, max %d byte):\n %s",
216 iString1, iMaxLength1, pcMsg1);
218 fprintf(
fLogFile,
" add msg for errno=%d\n", errno);
220 fprintf(
fLogFile,
" add string2 (%d byte, max %d byte):\n %s",
221 iString2, iMaxLength2, pcMsg2);
224 if ( (iString1 <= iMaxLength1) &&
225 (iString2 <= iMaxLength2) )
229 if (iMaxLength2 >= iMinLen)
231 sprintf(pcMsg2,
" %s\n", strerror(errno));
232 iString2 = strlen(pcMsg2);
233 iString = iString1 + iString2;
239 "-E- %s: 2nd string (%d byte) possibly too small for system error: requ. %d byte\n",
240 cModule, iMaxLength2, iMinLen);
246 if (iString < iMaxLength1)
248 strcat(pcMsg1, pcMsg2);
250 " returned msg (%d byte):\n %s", iString, pcMsg1);
254 strncat(pcMsg1, pcMsg2, iMaxLength1-iString1-1);
255 strcat(pcMsg1,
"\n");
256 iRC = iString -iMaxLength1;
259 fprintf(
fLogFile,
" returned msg:\n %s", pcMsg1);
261 pcc+= iMaxLength1-iString1-1;
262 fprintf(
fLogFile,
" skipped msg part:\n %s", pcc);
268 if (iMaxLength1 <= 0)
271 sprintf(cMsg,
"-E- %s: 1st string length (%d byte) invalid\n",
272 cModule, iMaxLength1);
274 if (iMaxLength2 <= 0)
277 sprintf(cMsg,
"-E- %s: 2nd string length (%d byte) invalid\n",
278 cModule, iMaxLength2);
280 else if (iString == 0)
283 sprintf(cMsg,
"-E- %s: empty strings provided\n", cModule);
285 else if (iString1 > iMaxLength1)
288 sprintf(cMsg,
"-E- %s: 1st string longer (%d byte) than length provided (%d)\n",
289 cModule, iString1, iMaxLength1);
291 else if ( (iString2 > iMaxLength2) && (iErrno == 0) )
294 sprintf(cMsg,
"-E- %s: 2nd string longer (%d byte) than length provided (%d)\n",
295 cModule, iString2, iMaxLength2);
306 iStringE = strlen(cMsg);
308 " error string (%d byte, max %d byte):\n %s\n",
309 iStringE, iMaxLengthE, cMsg);
311 if (iMaxLengthE < iStringE)
314 fprintf(
fLogFile,
"-E- %s: size error string too small: max %d byte (needed %d)",
315 cModule, iMaxLengthE, iStringE);
316 strncat(pcMsgE, cMsg, iMaxLengthE);
317 fprintf(
fLogFile,
", provided: %s\n", pcMsgE);
321 if (iDebug) fprintf(
fLogFile,
"%s", cMsg);
322 strcpy(pcMsgE, cMsg);
327 fprintf(
fLogFile,
"-D- end %s: rc=%d\n\n", cModule, iRC);
348 char cModule[32]=
"rawCheckClientFile";
358 char *plocd = NULL, *plocs = NULL;
359 char *pdelim = NULL, *pgen = NULL;
360 const char *pcSemi =
";";
361 char *pcc = NULL, *pBufTape, *pBufFile;
364 "\n-D- begin %s: test file %s\n", cModule, pcFile0);
368 strcpy(cTemp, pcFile0);
374 iRC = strncmp(cTemp,
"/dev", 4);
377 "-E- invalid file name: %s\n path names must not contain '%s'\n",
383 pdelim = strrchr(cTemp, *pcFileDelim);
384 if ( (pdelim == NULL) || (pdelim > plocd) )
387 "-E- invalid disk file name: %s\n path names must not contain '%s'\n",
398 "-E- invalid tape file name: %s\n name too long: max %d byte after dev name\n",
404 iRC = strncmp(++pcc,
"\0", 1);
409 "-E- file name must be specified explicitly\n");
411 fprintf(
fLogFile,
"-E- file name missing in %s\n", pcFile0);
419 plocs = strchr(cTemp, *pcSemi);
423 iRC = isalnum(*plocs);
426 iRC = isalpha(*plocs);
429 "-W- version number in file specification removed\n");
432 "-W- invalid version in file specification removed\n");
436 "-W- semicolon in file specification removed\n");
437 strncpy(--plocs,
"\0", 1);
438 strcpy(pcFile0, cTemp);
441 iDevType = rawCheckDevice(cTemp, pcFile, pcTape);
446 " no device name specified\n");
451 if (strlen(*pcFile) == 0)
452 fprintf(
fLogFile,
" disk device %s\n", *pcTape);
455 " file %s on disk %s\n", *pcFile, *pcTape);
461 if (strlen(*pcFile) == 0)
462 fprintf(
fLogFile,
" tape device %s\n", *pcTape);
464 fprintf(
fLogFile,
" file %s on tape %s\n", *pcFile, *pcTape);
468 fprintf(
fLogFile,
"-E- invalid file name %s\n", pcFile0);
482 "-E- node specification not allowed in file name: %s\n",
488 strncpy(plocd++,
"\0", 1);
489 strcpy(pBufTape, cTemp);
494 pgen = strchr(pBufTape, *
pcStar);
498 "-E- specified device %s has generic path\n", pBufTape);
500 " only the relative file name may be generic\n");
505 strcpy(pBufFile, plocd);
507 " file %s on tape %s\n", pBufFile, pBufTape);
508 strcpy(cText,
"tape");
514 strcpy(pBufFile, cTemp);
515 strcpy(cText,
"disk");
520 " %s file %s\n", cText, pBufFile);
522 pdelim = strrchr(pBufFile, *pcFileDelim);
529 "-E- path in tape file name not allowed: %s\n", pBufFile);
535 pgen = strchr(pBufFile, *
pcStar);
537 pgen = strchr(pBufFile, *
pcQM);
538 if ( (pgen != NULL) && (pgen < pdelim) )
541 "-E- specified %s file %s has wildcard chars in path name\n",
544 " only the relative file name may contain wildcard chars\n");
551 else pdelim = pBufFile;
554 if (strlen(pdelim) > ii)
557 "-E- rel file name %s too long:\n has %ld chars, max allowed %d\n",
558 pdelim, (
long) strlen(pdelim), ii);
569 iloc = isupper(*pcc);
573 "-W- upper case in (relative) file name not supported: %s\n",
576 *pcc = tolower(*pcc);
583 fprintf(
fLogFile,
" instead assumed: %s\n", pdelim);
587 "\n end %s: file name %s okay\n", cModule, pcFile0);
602 char cModule[32]=
"rawGetFSpName";
608 fprintf(
fLogFile,
"\n-D- begin %s\n", cModule);
611 if ( (strchr(pcUser, *
pcStar) != NULL) ||
612 (strchr(pcUser, *
pcQM) != NULL) )
615 "-E- %s: generic archive name '%s' not allowed\n",
622 fprintf(
fLogFile,
"-D- %s: FS %s, in %s-%s, delim %s\n",
623 cModule,
cNamefs, pcUser, pc, pcObjDelim);
624 if (strncmp(pc, pcObjDelim, 1) == 0)
632 if (isalpha(*pc) == 0)
635 "-E- archive name '%s' must start with a letter\n", pc);
641 "-D- end %s: FS %s\n",
cNamefs, cModule);
659 char cModule[32]=
"rawGetHLName";
668 "\n-D- begin %s\n path specified: %s\n", cModule, pcPath);
670 pdelim = strchr(pcPath, *pcObjDelim);
671 if (pdelim != pcPath)
675 " delimiter '%s' inserted at begin of archive path\n",
681 pdelim = strstr(
cNamehl,
"/./");
685 pdelim = strstr(cNameTemp,
"/./");
687 while (pdelim != NULL)
690 strncpy(pdelim,
"\0", 1);
697 pdelim = strstr(cNameTemp,
"/./");
700 " %d unnecessary './' removed\n", ii);
703 pdelim = strstr(
cNamehl,
"/.");
713 strncpy(pdelim,
"\0", 1);
715 " trailing '/.' removed\n");
720 " hl name: %s\n-D- end %s\n\n",
cNamehl, cModule);
739 char cModule[32] =
"rawGetLLName";
746 "\n-D- begin %s\n file %s, object delimiter %s\n",
747 cModule, pcFile, pcDelimiter);
749 strcpy(cNamell, pcDelimiter);
751 ploc = strrchr(pcFile, *pcFileDelim);
753 strcat(cNamell, ++ploc);
756 ploc = strrchr(pcFile, *pcObjDelimAlt);
758 strcat(cNamell, ++ploc);
764 strcat(cNamell, ++ploc);
768 strcat(cNamell, pcFile);
771 strcpy(pcObject, cNamell);
774 " ll name %s\n-D- end %s\n\n", pcObject, cModule);
788 unsigned long *piSize,
789 unsigned int *piRecl)
791 char cModule[32] =
"rawGetFileSize";
796 unsigned long iSize = 0;
799 struct _stat sFileStatus, *pFileStatus;
801 struct stat sFileStatus, *pFileStatus;
805 "\n-D- begin %s: file %s\n", cModule, pcFile);
807 pFileStatus = &sFileStatus;
810 iRC = _stat(pcFile, pFileStatus);
812 iRC = stat(pcFile, pFileStatus);
817 "-E- %s: file %s unavailable (stat)\n", cModule, pcFile);
820 fprintf(
fLogFile,
" %s\n", strerror(errno));
823 if (strcmp(strerror(errno),
824 "Value too large for defined data type") == 0)
827 "-E- %s: file size of %s > 2 GByte: use 64 bit gStore client\n",
840 iRecl = pFileStatus->st_fab_mrs;
845 iRecl = pFileStatus->st_blksize;
848 iSize = pFileStatus->st_size;
849 if (pFileStatus->st_mode & S_IFREG)
853 " file %s: size %lu, recl %d (byte)\n",
854 pcFile, iSize, iRecl);
858 if (pFileStatus->st_mode & S_IFDIR)
862 "-W- %s is a directory, size %lu\n", pcFile, iSize);
866 else if (pFileStatus->st_mode & S_IFLNK)
870 "-W- %s is a symbolic link, size %lu\n", pcFile, iSize);
878 "-W- unexpected item %s, size %lu\n", pcFile, iSize);
885 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
903 char cModule[32] =
"rawGetPathName";
906 char *ploc = NULL, *ploc1 = NULL;
910 fprintf(
fLogFile,
"-D- begin %s: hl: %s\n", cModule, pcNamehl);
912 if (strlen(pcNamehl) == 0)
914 fprintf(
fLogFile,
"-E- %s: high level name empty\n", cModule);
919 ploc = strchr(pcNamehl, *pcObjDelim);
920 ploc1 = strchr(pcNamehl, *pcObjDelimAlt);
921 if ( (ploc != pcc) && (ploc1 != pcc) )
924 "-E- %s: invalid prefix in high level name %s\n",
931 "-D- end %s: path %s\n\n", cModule,
cPath);
952 char cModule[32] =
"rawQueryFile";
959 int iIdent, iQuery = -1, iAttrLen;
961 int iStatus, iStatusLen;
966 int iVersionObjAttr = 0;
980 iAction = ntohl(pComm->
iAction);
986 "\n-D- begin %s: query file %s in ATL Server %d (action %d)\n",
1005 "-E- %s: invalid action %d\n", cModule, iAction);
1010 pcc = (
char *) pComm;
1011 iRC = send(iSocket, pcc, (
unsigned) iBufComm, 0);
1015 "-E- %s: sending command buffer for query file %s\n",
1018 "-E- %s: query command buffer incompletely sent (%d of %d byte)\n",
1019 cModule, iRC, iBufComm);
1023 fprintf(
fLogFile,
" %s\n", strerror(errno));
1032 " query command sent to entry server (%d bytes), look for reply\n",
1038 pcc = (
char *) pQuery;
1043 "-E- %s: receiving buffer header with query information\n",
1050 iIdent = ntohl(pQuery->
iIdent);
1052 iAttrLen = ntohl(pQuery->
iAttrLen);
1055 " %d bytes received: iIdent %d, iQuery %d, iAttrLen %d\n",
1056 iRC, iIdent, iQuery, iAttrLen);
1066 iStatusLen = iAttrLen;
1073 "-E- %s: error status from entry server instead of query data:\n",
1080 "-E- receiving error msg from server, rc = %d\n",
1082 else if ( (iDebug) || (iStatus ==
STA_ERROR) ||
1087 fprintf(
fLogFile,
" no error message available\n");
1097 "-E- %s: unexpected status (type %d) received from server\n",
1102 "-E- %s: unexpected header (type %d) received from server\n",
1111 iQueryAll += iQuery;
1118 for (ii=1; ii<=iQuery; ii++)
1123 if ( (iRC = recv( iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1128 "-E- %s: receiving buffer %d with query results\n",
1132 iQueryAll -= iQuery;
1136 jj = iAttrLen - iBuf;
1138 "-E- %s: connection to server broken, only %d bytes of query object %d (%d byte) received\n",
1139 cModule, jj, ii, iAttrLen);
1144 iQueryAll -= iQuery;
1149 "-E- %s: only %d of %d objects received\n",
1150 cModule, --ii, iQuery);
1151 iQueryAll -= iQuery - ii;
1158 fprintf(
fLogFile,
" %s\n", strerror(errno));
1170 iVersionObjAttr = ntohl(pObjAttr->
iVersion);
1175 "-E- %s: invalid cacheDB entry version %d\n",
1176 cModule, iVersionObjAttr);
1182 iPoolId = ntohl(pObjAttr->
iPoolId);
1186 " query buffer received (%d bytes, objAttr data V%d)\n",
1187 iAttrLen, iVersionObjAttr);
1189 " query buffer overlaid (%d bytes)\n", iAttrLen);
1191 fprintf(
fLogFile,
" %s%s%s: poolId %d",
1195 fprintf(
fLogFile,
" (RetrievePool)\n");
1196 else if (iPoolId == 2)
1197 fprintf(
fLogFile,
" (StagePool)\n");
1198 else if (iPoolId == 3)
1199 fprintf(
fLogFile,
" (ArchivePool)\n");
1200 else if (iPoolId == 4)
1207 else if ( (iQuery == 0) && (iDebug) )
1209 " no more objects found in ATL server %d\n",
iATLServer);
1222 if ( (iNameWC == 0) && (iQuery > 0) )
1233 " no matching object %s in gStore found\n",
1238 " file %s available in gStore\n", pComm->
cNamell);
1242 "-E- %s: query in gStore could not be executed\n",
1248 " requested archive %s not existing in gStore\n",
1253 " requested access to file %s not allowed\n",
1259 if (strcmp(pComm->
cOwner,
"goeri") == 0)
1260 fprintf(
fLogFile,
"-W- %d versions of %s exist!\n",
1266 "-E- %s: invalid number %d of objects %s found\n",
1267 cModule, iQuery, pComm->
cNamell);
1273 "-D- end %s\n\n", cModule);
1288 char cModule[32]=
"rawRecvError";
1296 fprintf(
fLogFile,
"\n-D- begin %s\n", cModule);
1305 if ( (iRC = recv(iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1310 "-E- %s: receiving error message\n", cModule);
1314 fprintf(
fLogFile,
" %s\n", strerror(errno));
1331 "-E- incomplete error message received:\n %s", pcMsg);
1334 "-E- %s: connection to sender broken, %d byte of error message (%d byte) received\n",
1339 fprintf(
fLogFile,
" %s\n", strerror(errno));
1356 "-E- %s: more error data received than expected:\n %s",
1364 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
1380 " error message received (%d bytes):\n %s",
1382 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
1400 char cModule[32]=
"rawRecvHead";
1412 fprintf(
fLogFile,
"\n-D- begin %s\n", cModule);
1422 iRC = recv(iSocket, pcc, (
unsigned) iBuf, 0);
1426 "-E- %s: receiving buffer header\n", cModule);
1431 "-E- %s: connection to sender broken, %d byte of buffer header (%d byte) received\n",
1432 cModule, ii, iBufs);
1437 fprintf(
fLogFile,
" %s\n", strerror(errno));
1449 iIdent = ntohl(*pint);
1451 iStatus = ntohl(*pint);
1453 iDataLen = ntohl(*pint);
1455 " ident %d, status %d, datalen %d\n",
1456 iIdent, iStatus, iDataLen);
1463 "-W- %s: error message available for receive (%d byte)\n",
1469 "-D- end %s: buffer header received (%d bytes)\n\n",
1501 char cModule[32] =
"rawRecvHeadC";
1518 fprintf(
fLogFile,
"\n-D- begin %s\n", cModule);
1520 if (iIdentReq < 0) fprintf(
fLogFile,
1521 " check Ident, expect %d\n", iIdentReq);
1523 fprintf(
fLogFile,
" no check of Ident\n");
1524 if (iStatusReq >= 0) fprintf(
fLogFile,
1525 " check Status, expect %d\n", iStatusReq);
1527 fprintf(
fLogFile,
" no check of Status\n");
1538 if ( (iRC = recv( iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1542 sprintf(pcMsg,
"-E- %s: receiving buffer header\n",
1550 "-E- %s: connection to sender broken, %d byte of buffer header (%d byte) received\n",
1551 cModule, ii, iBufs);
1557 snprintf(cMsg1,
sizeof(cMsg1),
" %s\n", strerror(errno));
1558 strcat(pcMsg, cMsg1);
1574 " buffer header received (%d bytes)\n", iBufs);
1576 pint = (
int *) pcBuf;
1577 iIdent = ntohl(*pint);
1579 iStatus = ntohl(*pint);
1581 iDataLen = ntohl(*pint);
1584 " ident %d, status %d, datalen %d\n",
1585 iIdent, iStatus, iDataLen);
1591 fprintf(
fLogFile,
" status received");
1594 fprintf(
fLogFile,
" with error message\n");
1607 sprintf(pcMsg,
"-E- %s: receiving error msg, rc=%d\n",
1617 " msg (%d byte): %s\n", iDataLen, pcc);
1619 iRC = strlen(pcMsg);
1623 if ( (iDataLen == 0) &&
1627 "-W- error status received, but no error message\n");
1636 fprintf(
fLogFile,
" check identifier\n");
1638 if (iIdent != iIdentReq)
1641 "-E- %s: unexpected header (ident %d) received\n",
1652 if (iStatusReq >= 0)
1655 fprintf(
fLogFile,
" check status\n");
1657 if (iStatusReq != iStatus)
1660 "-E- %s: unexpected header (status %d) received\n",
1676 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
1700 char cModule[32]=
"rawRecvRequest";
1714 "\n-D- begin %s: receive request buffer\n", cModule);
1716 pRequest = &sRequest;
1717 pcc = (
char *) pRequest;
1722 if ( (iRC = recv( iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1727 "-E- %s: receiving buffer header\n", cModule);
1734 "-W- %s: connection to sender broken, %d byte of buffer header (%d byte) received\n",
1735 cModule, ii, iimax);
1739 goto gErrorRecvRequest;
1750 "-E- %s: more buffer header data received than expected\n",
1754 goto gErrorRecvRequest;
1759 " buffer header received (%d bytes, id %d)\n",
1760 iimax, pRequest->
iIdent);
1765 fprintf(
fLogFile,
"-E- %s: invalid buffer received (id %d)\n",
1766 cModule, pRequest->
iIdent);
1768 goto gErrorRecvRequest;
1780 if ( (iRC = recv( iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1785 "-E- %s: receiving buffer data\n", cModule);
1792 "-W- %s: connection to sender broken, %d byte of data (%d byte) received\n",
1793 cModule, ii, iBuf0);
1799 fprintf(
fLogFile,
" %s\n", strerror(errno));
1803 goto gErrorRecvRequest;
1813 fprintf(
fLogFile,
"-E- %s: more data received than expected\n",
1816 goto gErrorRecvRequest;
1822 " %s: request data received (%d bytes)\n", cModule, iBuf0);
1827 "-E- %s: invalid data size (%d) in request buffer (expected %d byte)\n",
1828 cModule, iBuf0, iRequSize-
HEAD_LEN);
1830 goto gErrorRecvRequest;
1833 *piSeekMode = ntohl(pRequest->
iSeekMode);
1834 *piOffset = ntohl(pRequest->
iOffset);
1838 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
1849 " %s: status info received: end session\n", cModule);
1856 "-W- %s: error status received: end session\n", cModule);
1858 "-W- %s: error message from client:\n %s\n",
1861 goto gErrorRecvRequest;
1866 "-E- %s: invalid status buffer received (id %d)\n",
1869 goto gErrorRecvRequest;
1873 goto gErrorRecvRequest;
1878 fprintf(
fLogFile,
"-E- %s: invalid buffer received (ident %d)\n",
1879 cModule, pRequest->
iIdent);
1881 goto gErrorRecvRequest;
1886 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
1906 char cModule[32]=
"rawRecvStatus";
1916 fprintf(
fLogFile,
"\n-D- begin %s\n", cModule);
1920 memset(pcc, 0x00,
sizeof(
HEAD_LEN));
1926 if ( (iRC = recv( iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1929 "-E- %s: receiving status header\n", cModule);
1934 "-E- %s: connection to sender broken, %d byte of status header (%d byte) received\n",
1935 cModule, ii, iBufs);
1940 fprintf(
fLogFile,
" %s\n", strerror(errno));
1955 "-E- %s: more status header data received than expected\n",
1966 fprintf(
fLogFile,
" status header received (%d bytes)\n",
1968 fprintf(
fLogFile,
" ident %d, status %d, status len %d\n",
1974 fprintf(
fLogFile,
"-E- %s: invalid status header received (%d)\n",
1975 cModule, pStatus->
iIdent);
1982 memset(pcc, 0x00, (
unsigned) iLen);
1987 if ( (iRC = recv( iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1990 "-E- %s: receiving status message\n", cModule);
1995 "-E- %s: connection to sender broken, %d byte of status message (%d byte) received\n",
2001 fprintf(
fLogFile,
" %s\n", strerror(errno));
2016 "-E- %s: more status data received than expected\n",
2022 " status message received (%d bytes):\n%s\n",
2028 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
2048 char cModule[32]=
"rawSendRequest";
2058 "\n-D- begin %s: send request buffer\n", cModule);
2068 sRequest.
iOffset = htonl(iOffset);
2069 if (iBufferSize < 0)
2072 "-E- %s: invalid buffer size %d\n", cModule, iBufferSize);
2078 pcc = (
char *) &sRequest;
2079 iRC = send(iSocket, pcc, (
unsigned) iBuf, 0);
2083 "-E- %s: sending request buffer\n", cModule);
2085 "-E- %s: request buffer incompletely sent (%d of %d byte)\n",
2086 cModule, iRC, iBuf);
2090 fprintf(
fLogFile,
" %s\n", strerror(errno));
2098 "-D- end %s: request buffer sent\n\n", cModule);
2115 char cModule[32]=
"rawSendStatus";
2124 "\n-D- begin %s: send status buffer (%d) to socket %d\n",
2125 cModule, iStatus, iSocket);
2128 sStatus.
iStatus = htonl(iStatus);
2134 iMsgLen = strlen(pcMsg);
2139 strcpy(sStatus.
cStatus, pcMsg);
2141 " %s: error message (%d bytes):\n %s\n",
2142 cModule, iMsgLen, pcMsg);
2145 pcc = (
char *) &sStatus;
2149 " now send (iIdent %d, iStatus %d, iStatusLen %d), %d byte:\n",
2155 iRC = send(iSocket, pcc, (
unsigned) iBuf, 0);
2159 "-E- %s: sending status buffer\n", cModule);
2161 "-E- %s: status buffer incompletely sent (%d of %d byte)\n",
2162 cModule, iRC, iBuf);
2166 fprintf(
fLogFile,
" %s\n", strerror(errno));
2174 "-D- end %s: status buffer sent (%d byte)\n\n", cModule, iBuf);
2190 char cModule[32] =
"rawTestFileName";
2196 unsigned long lFileSize = 0;
2197 unsigned int iSize = 0;
2201 "-D- begin %s: input file name %s\n", cModule, pcFile);
2203 if ( (pdir = strrchr(pcFile,
'*')) != NULL)
2206 "-E- invalid file name '%s': '*' not allowed as part of file name\n",
2212 if ( (pdir = strrchr(pcFile,
'?')) != NULL)
2215 "-E- invalid file name '%s': '?' not allowed as part of file name\n",
2221 if ( (pdir = strrchr(pcFile,
'/')) == NULL)
2224 fprintf(
fLogFile,
" name %s okay\n", pcFile);
2228 ilen = strlen(pdir);
2230 " trailor %s (len %d)\n", pdir, ilen);
2233 strncpy(pdir,
"\0", 1);
2235 fprintf(
fLogFile,
" %s is a directory\n", pcFile);
2240 fprintf(
fLogFile,
" rel name %s okay\n", pcFile);
2245 " after rawGetFileSize, rc = %d\n", iRC);
2251 fprintf(
fLogFile,
"-W- %s NOT archived", pcFile);
2253 fprintf(
fLogFile,
" - is a directory\n");
2255 fprintf(
fLogFile,
" - is a symbolic link\n");
2257 fprintf(
fLogFile,
" - is not a regular file\n");
2267 " %s is a regular file\n", pcFile);
2271 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
static char cPath[MAX_FULL_FILE]
int rawTestFileName(char *pcFile)
int rawAddStrings(char *pcMsg1, int iMaxLength1, char *pcMsg2, int iMaxLength2, int iErrno, char *pcMsgE, int iMaxLengthE)
int rawRecvError(int iSocket, int iLen, char *pcMsg)
int rawRecvStatus(int iSocket, char *pcBuf)
int rawCheckClientFile(char *pcFile0, char **pcFile, char **pcTape)
int rawRecvHeadC(int iSocket, char *pcBuf, int iIdentReq, int iStatusReq, char *pcMsg)
int rawRecvRequest(int iSocket, int *piSeekMode, int *piOffset, int *piBufferSize)
static char cNamefs[MAX_OBJ_FS]
int rawRecvHead(int iSocket, char *pcBuf)
int rawSendStatus(int iSocket, int iStatus, char *pcMsg)
int rawSendRequest(int iSocket, int iSeekMode, int iOffset, int iBufferSize)
int rawGetFileSize(char *pcFile, unsigned long *piSize, unsigned int *piRecl)
char * rawGetHLName(char *pcPath)
int rawQueryFile(int iSocket, int iAltMaster, srawComm *pCommBuf, void **pQueryBuf)
char * rawGetPathName(char *pcNamehl)
int rawGetLLName(char *pcFile, const char *pcDelimiter, char *pcObject)
char * rawGetFSpName(char *pcUser)
static char cNamehl[MAX_OBJ_HL]
#define IDENT_QUERY_ARCHDB
#define VERSION_SRAWOBJATTR
#define IDENT_NEXT_BUFFER
static const char * pcDevDelim
static const char * pcPerc
static const char * pcStar