MCPcopy Create free account
hub / github.com/SIPp/sipp / getFieldFromInputFile

Method getFieldFromInputFile

src/call.cpp:6571–6596  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6569}
6570
6571void call::getFieldFromInputFile(const char *fileName, int field, SendingMessage *lineMsg, char*& dest)
6572{
6573 if (m_lineNumber == nullptr) {
6574 ERROR("Automatic calls (created by -aa, -oocsn or -oocsf) cannot use input files!");
6575 }
6576 if (inFiles.find(fileName) == inFiles.end()) {
6577 ERROR("Invalid injection file: %s", fileName);
6578 }
6579 int line = (*m_lineNumber)[fileName];
6580 if (lineMsg) {
6581 char lineBuffer[20];
6582 char *endptr;
6583 createSendingMessage(lineMsg, SM_UNUSED, lineBuffer, sizeof(lineBuffer));
6584 line = (int) strtod(lineBuffer, &endptr);
6585 if (*endptr != 0) {
6586 ERROR("Invalid line number generated: '%s'", lineBuffer);
6587 }
6588 if (line > inFiles[fileName]->numLines()) {
6589 line = -1;
6590 }
6591 }
6592 if (line < 0) {
6593 return;
6594 }
6595 dest += inFiles[fileName]->getField(line, field, dest, SIPP_MAX_MSG_SIZE);
6596}
6597
6598call::T_AutoMode call::checkAutomaticResponseMode(char* P_recv)
6599{

Callers

nothing calls this directly

Calls 4

ERRORFunction · 0.85
findMethod · 0.80
numLinesMethod · 0.80
getFieldMethod · 0.80

Tested by

no test coverage detected